Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
The sample table:
Group | Date | Sales |
A | Dec | 100 |
A | Jan | 100 |
A | Feb | 100 |
A | Mar | 100 |
B | Jan | 100 |
B | Feb | 100 |
B | Mar | 100 |
The slicer applied:
I want the table to look like:
Group | Date | Sales | GroupTotal |
A | Jan | 100 | 200 |
A | Feb | 100 | 200 |
B | Jan | 100 | 200 |
B | Feb | 100 | 200 |
the Group total representing the subtotal by group.
A = CALCULATE( SUM('Table'[Sales]),ALLSELECTED())
Group | Date | Sales | A |
A | Jan | 100 | 400 |
A | Feb | 100 | 400 |
B | Jan | 100 | 400 |
B | Feb | 100 | 400 |
this gets the total for everything that is not filterred out not a subtotal fro each group though.
B=CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date]))
Group | Date | Sales | B |
A | Jan | 100 | 400 |
A | Feb | 100 | 400 |
B | Jan | 100 | 300 |
B | Feb | 100 | 300 |
this gets a subtotal for each group. This subtotal includes data that was filtered out.
How can I do both?
Hi @v-jacogs,
You could try to create the measure below to get your excepted output.
Group_total = CALCULATE ( SUM ( test[Sales] ), ALLSELECTED ( test[Group] ) )
Then you will get the result.
In addition, you could create the Matrix visual and get the Subtotal simply as below.
Hope it can help you!
Best Regards,
Cherry
I have the same problem, and your solution seems not working for me...
Could you take a look and find why, please?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |