Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I'm running some test to set my (pretty simple) measure but there is a thing that I dont understand.
When I use :
Version1 =
2 + CALCULATE(sum(FORECAST[Forecast]),filter(FORECAST,FORECAST[position]<=2))My result is correct.
The constant 2 (used 2 times) is actually the result of another measure X. And I confirm that when I check the result of this measure, it is 2.
And when I use :
Version2 =
X + CALCULATE(sum(FORECAST[Forecast]),filter(FORECAST,FORECAST[position]<=X))The result is not correct.
I'm sure that the first X is correctly interpreted as a 2, but not the 2nd one.
I don't understand this and i'm not able to find the logic used to find the same result than the machine.
Do you think the use of X inside Calculate + filter changes somehow the meaning of the calculation ?
Thank you for your help
Thanks for your answer, but actually I have completely changed my datamodel, and I.m not exposed to this problem anymore.... I guess I did something bad in my first datamodel.
Thank you guys for having tried to help.
Hi @Anonymous ,
If your metric is placed in a view with multiple fields, the results will be affected by rows, as in the following simple example.
x = CALCULATE(sum(FORECAST[Forecast]),filter(FORECAST,FORECAST[position]=2))
If you want the x measure to return the same result in all rows, add the ALL function.
x = CALCULATE(sum(FORECAST[Forecast]),filter(ALL(FORECAST),FORECAST[position]=2))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , As a measure, is calculated at each row and grand total level. Your calculation will change based on that
You need to use some kind group
Version2 =
sumx(values(FORECAST[columns]), X + CALCULATE(sum(FORECAST[Forecast]),filter(FORECAST,FORECAST[position]<=X)))
change columns to with group by you want in visual
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 81 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |