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 There,
I am trying to replicate a formula I found on youtube but without success, would anyone know how to solve the problem
Formula that I am trying to copy:
Running Total = VAR ThisHeaderID = SELECTEDVALUE(Header[Header Sort])
VAR Result = CALCULATE([Magic Additive Total], ALL(Header), Header[Header Sort] <= ThisHeader ID)
RETURN Result
My formula:
Solved! Go to Solution.
Hi, @Anonymous
According to your DAX formula and error message, I think the true reason for this problem is that you didn’t use “return” to return the value you want the measure to return. Because if you used the “VAR” statement to define a variable, you have to use the "return" to return the result. You can try to change the DAX formula like this:
Grouping Running Total=
VAR GroupID=SELECTVALUE(‘Account & Account Group’[Group ID])
return
GroupID
More detail about “VAR” in DAX
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
I'm perplexed as to what I've missed. Was there something wrong with the answer I supplied on Friday? Which says the same as the answer you accepted that was posted just a few hours ago?
Regards
Phil
Proud to be a Super User!
Hi, @Anonymous
According to your DAX formula and error message, I think the true reason for this problem is that you didn’t use “return” to return the value you want the measure to return. Because if you used the “VAR” statement to define a variable, you have to use the "return" to return the result. You can try to change the DAX formula like this:
Grouping Running Total=
VAR GroupID=SELECTVALUE(‘Account & Account Group’[Group ID])
return
GroupID
More detail about “VAR” in DAX
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
When you use VAR in a measure you must use RETURN to return a value. In this instance you don't need either VAR or RETURN, the measure can be simplified.
So the correct syntax is
Group Running Total = SELECTEDVALUE('Account & Account Group'[Groupp ID])
regards
Phil
Proud to be a Super User!
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |