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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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