Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hi Everyone,
Im sure the title is a bit confusing but is there a way I can show a subtotal of sub items even though I only want it to show top 3 for example assume the visualization without any filters would look like this.
Item Colour Value
Coffee Mug
Red 1
Green 5
Blue 3
Black 2
Total 11
Coffee Table
Red 1
Green 2
Blue 10
Black 3
Total 16
Bookcase
Red 1
Green 3
Blue 4
Black 10
Total 18
What I want it to show is only the top 3 sub items of each item , but i want the total to remain the actual total of all sub items. So this is what i want it to show:
Item Colour Value
Coffee Mug
Green 5
Blue 3
Black 2
Total 11
Coffee Table
Blue 10
Black 3
Green 2
Total 16
Bookcase
Black 10
Blue 4
Green 3
Total 18
I have a measure that just does a simple count of items.
and I have another measure for ranking:
top_3_measure = rankx(all('table'[Colour]), CALCULATE(count('Table'[Item])))
I then use this filter into the matrix visual level filter and put it as less than 4 to only get the top 3 sub items.
The issue im having right now is the totals only reflective of the sub items shown so it shows as this right now:
Item Colour Value
Coffee Mug
Green 5
Blue 3
Black 2
Total 10
Coffee Table
Blue 10
Black 3
Green 2
Total 15
Bookcase
Black 10
Blue 4
Green 3
Total 17
hi, you can solve your problem with this dax:
ValueAll = IF ( HASONEVALUE ( Table1[Colour] ), SUM ( Table1[Value] ), CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Item] ) ) )
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
73 | |
71 | |
69 | |
46 | |
44 |
User | Count |
---|---|
46 | |
38 | |
28 | |
28 | |
28 |