Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello -
I have the following Matrix visual:
Rows:
- 'D SalesRep'[Name]
- 'D Customer'[Name]
- 'D SalesType'[Name]
- 'D Product'[Group Code Description]
- 'D Product'[Code]
Values (currently include 3 measures):
- [Sales Amount] = SUM('F Sales'[Sales])
- [M Contract] = [Sales Amount] * 2
- [M Direct] =
NOTE: The measures for [M Contract] & [M Direct] are arbitrary. In this case they are dummy measures, but in reality could hold any calculation.
The goal in the matrix visual is to replace [M Contract] & [M Direct] with a new measure called [Sales Based on Type], which calls these different measures based on the matrix row values.
Something like the following:
IF('D SalesType'[Name] = "Contract", [M Contract],
IF('D SalesType'[Name] = "Direct", [M Direct]))
Additionally, IF the granularity in the matrix is HIGHER than 'D SalesType'[Name] (e.g. SalesRep or Customer), THEN the totals rows should correctly calculate the sums of the different measures from the lower granularity of 'D SalesType'[Name].
Regards,
Nathan
Good catch. So this is the entire 'F Sales' table, and there are no common products sold by both Sales Reps.
I did notice that the Total for [M Contract] is the sum of row values,
whereas the Total for [M Direct] is NOT the sum of row values.
Not sure, but I'm guessing this is because [M Contract] is additive & [M Direct] is non-additive.
Something like what Ferrari describes here: https://www.youtube.com/watch?v=6rgAkejrup8
Ferrari mentions that averages are non additive measures.
So I'm wondering if because there is a division operator in [M Direct], it causes it to be non-additive?
Regards,
Nathan
@WinterMist
You are right. [M Direct] is non-additive. But I guess it makes sense to force additivity.
It just hit me. I think the SUMX iterator over 'D SalesType' does it.
If anyone has a different suggestion, let me know.
Regards,
Nathan
@WinterMist
Good job!
For some reason the total shows 189 instead of 192. Seems there are common products sold by both salesReps. I guess they still need to be counted twice?
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |