Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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]) )
?
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |