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! Request now

Reply
Anonymous
Not applicable

Aggregation not working with dim table

Hi all,

I am struggling to calculate an aggregated KPI displayed in a matrix.

Let's say I have a dim country table related to a fact sales table :

AR_Coordo_0-1708034761741.png

Country table:

AR_Coordo_3-1708035053142.png

Sales table :

AR_Coordo_4-1708035070460.png

 


My sales are calculated by month and country/city.
I want to display on a matrix the sales total  regardless of the month by country/city and month.

I used this measure :

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]), ALLEXCEPT(Sales, Sales[FK]))

 

However, the result is :

AR_Coordo_1-1708034971254.png


But I want to obtain this :

AR_Coordo_2-1708034997615.png

 

Any idea why it is not working ?

 

Thank you in advance for your help !

 

Regards,

 

Alice

1 ACCEPTED SOLUTION
Daniel29195
Super User
Super User

@Anonymous 

 

use this modified version of the code : 

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]), removefilters(sales[Month]) )

or

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]), all(Sales) , values(sales[FK]))


 

 

let me know if this helps .

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

View solution in original post

2 REPLIES 2
Daniel29195
Super User
Super User

@Anonymous 

 

use this modified version of the code : 

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]), removefilters(sales[Month]) )

or

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]), all(Sales) , values(sales[FK]))


 

 

let me know if this helps .

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Anonymous
Not applicable

Thank you for your answer, it worked !

Any idea why it doesn't work if I filter my sales by antoher column from the same table, like 

Total_Sales_Per_Country = calculate(sum('Sales'[Sales]),'Sales'[Category]="XXX", removefilters(sales[Month]) )

?

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.

Top Solution Authors