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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.