Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PaulPalkowski
Helper II
Helper II

Matrix Column Sum

I have a very simple table from excel

AnimalFood
TigerFish
ElephantVeggies
BearFish
Monkey 
TigerCombo
ElephantFish
Bear 
MonkeyVeggies
Tiger 
BearFish
Tiger 

 

Using a DistinctCount Measure I am using this

DC-Animals = DISTINCTCOUNTNOBLANK(Sample2[Animal])
 
my Matrix looks like this...
2024-09-11 14_59_42-Untitled - Power BI Desktop.png
The row subtotals work, but how can I get the column subtotals to work?
I am looking for this as a result
2024-09-11 14_59_42-Untitled - Power Bi results.png
So using count, all the totals work
But I don't want to use count,
I am not insterted if the bear had 2 servings of fish, as long as he had 1
and I do need to know if the tiger and elephant had more than 1 food type
 
so below is not what I am looking for
not what I want.png
I hope this makes sense
 
 
 
 
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@PaulPalkowski,

 

Try this measure:

 

DC-Animals =
SUMX (
    SUMMARIZE ( Sample2, Sample2[Animal], Sample2[Food] ),
    CALCULATE ( DISTINCTCOUNTNOBLANK ( Sample2[Animal] ) )
)

 

DataInsights_0-1726087628621.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@PaulPalkowski,

 

Try this measure:

 

DC-Animals =
SUMX (
    SUMMARIZE ( Sample2, Sample2[Animal], Sample2[Food] ),
    CALCULATE ( DISTINCTCOUNTNOBLANK ( Sample2[Animal] ) )
)

 

DataInsights_0-1726087628621.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Perfect!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.