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
Anonymous
Not applicable

Matrix with Concatenated Measures and Correct Totals

I am trying to create a matrix that shows both the sum and count for each combination of two categorical variables. I have figured out a formula that gives me the right individuals cells and one that gives the right total rows, but not both at the same time.  Trying to use HASONEVALUE(), but it isn't working.
 
Dummy data:
CAT1CAT2VAR1
A1B10.25
A1B20.75
A1B20.5
A2B20.25
A2B20.5

 

Desired outcome:

 B1B2Total
A1.25 (1)    1.25 (2)  1.5 (3)
A2   .75 (2)  .75 (2)
Total.25 (1)    2 (4)  2.25 (5)

 

Thanks for the help!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

I think you just need to drag field "var1" into the value of the matrix again and then change the type to " count"

 

pbix attached

 

70.png

 

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

I think you just need to drag field "var1" into the value of the matrix again and then change the type to " count"

 

pbix attached

 

70.png

 

Best Regards,
Community Support Team _ Eason

Greg_Deckler
Community Champion
Community Champion

@Anonymous - This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Seems like you are headed down this track. You might try using ISINSCOPE instead of HASONEVALUE. Hard to say without knowing the measure formula. (hint)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.