Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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]) )
?
User | Count |
---|---|
99 | |
86 | |
78 | |
75 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |