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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors