Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
christianirgens
Frequent Visitor

Error in CALCULATE ALL

I'm experiencing erratic results from CALCULATE(measure, ALL(field)) statements when using page filters to filter other fields with a large number of distinct values. The problem also occurs if positive fields are filtered with ">-1". The problem is fixed/reduced if the field is replaced by a rounded version (i.e. fewer distict values), but can reoccur when using several page-filters. Example attached. 

 

A serious bug?

1 ACCEPTED SOLUTION

3 REPLIES 3
christianirgens
Frequent Visitor

I was not able to attach the pbix file - but try the following:

Generate a data set containing 100 000 rows with the following: 

RandomValue=INT(RAND()*10000)

RandomRounded=ROUND(RandomValue,-3)

Group=INT(RAND()*3)

Value=INT(RAND()*10000)

 

Then construct the following measure 

SumValueIgnoringGroup = calculate(sum(Data[Value]),all(Data[Group])) and use this in a Card. 

Add chart using the group-field - and see that the Card is unaffected by filtering (as it should be). 

The try using the pagefilter to filter for RandomValue>-1  and see how the Card is erronously affected when you click on the groups. 

If you filter RandomRounded >-1 the Card works ok. 

 

 

This was answered in https://community.powerbi.com/t5/Issues/CALCULATE-ALL-BUG/idi-p/1283779

(I.e. this is an "error by design"). 

Hi @christianirgens ,

 

Value of RAND() keeps changing with every refresh.

 

Not sure what the problem statement for you is. 

 

Incase you are looking for generating nos. you can have a look at this articles.

 

https://www.sqlbi.com/articles/generating-a-series-of-numbers-in-dax/

 

Regards,

Harsh Nathani

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.