Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 :
Country table:
Sales table :
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 :
However, the result is :
But I want to obtain this :
Any idea why it is not working ?
Thank you in advance for your help !
Regards,
Alice
Solved! Go to Solution.
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! 🤠
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! 🤠
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]) )
?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
165 | |
83 | |
68 | |
68 | |
59 |