Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Another newbie question, I'm confused over the use of variables.
In the first statement below, I'm able to define, myValue = [Value] (created by GENERATESERIES () and use this in the second argument for GENERATE().
However in the second statement, I'm trying to do the same thing with ADDCOLUMNS() yet it produces an error ( 'Parameter is not the correct Type, cannot find [Value]'
Can someone help explain?
NewTable =
GENERATE(
GENERATESERIES ( 0, 10, 0.5 )
, VAR myValue = [Value]
return
row("Test",myValue)
)
NewTable =
ADDCOLUMNS(
GENERATESERIES ( 0, 10, 0.5 )
, VAR myValue = [Value]
return
"Test",myValue
)
Solved! Go to Solution.
You must use the variable inside the expression where value is evaluated
so this should work
NewTable =
ADDCOLUMNS(
GENERATESERIES ( 0, 10, 0.5 )
,
"Test",VAR myValue = [Value]
return myValue
)
Try like
NewTable =
ADDCOLUMNS(
GENERATESERIES ( 0, 10, 0.5 )
,
"Test", [Value]
)
Thanks for the reply but you've not answered the question, I'm trying to understand why the variable produces an error in the second senario, when it's usage is the same as the first (where there is no error).
You must use the variable inside the expression where value is evaluated
so this should work
NewTable =
ADDCOLUMNS(
GENERATESERIES ( 0, 10, 0.5 )
,
"Test",VAR myValue = [Value]
return myValue
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |