Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use local variable before its declared "affectedMeasuresColumnName" before it is declared #32

Open
back1ply opened this issue Sep 22, 2024 · 1 comment

Comments

@back1ply
Copy link

Error

Cannot use local variable before its declared "affectedMeasuresColumnName" before it is declared
like 107 and 110 i think

https://github.com/PowerBI-tips/TabularEditor-Scripts/blob/main/Advanced/One-Click%20Macros/Time%20Intelligence%20Calculation%20Group%20Creation.csx

@back1ply
Copy link
Author

fixed the issue

(right is the fixed one)
image

string affectedMeasuresColumnName;

if(Model.Tables.Any(t => t.GetAnnotation("@AgulloBernat") == "Time Intel Affected Measures Table")) {
    affectedMeasuresColumnName = Model.Tables.Where(t => t.GetAnnotation("@AgulloBernat") == "Time Intel Affected Measures Table").First().Columns.First().Name;

} else {
    affectedMeasuresColumnName = Interaction.InputBox("Provide a name for affected measures column", "Affected Measures Table Column Name", "Measure", 740, 400);

};

if(affectedMeasuresColumnName == "") return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant