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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WuchaDoin
Frequent Visitor

Trying to get a simple count of sales in a matrix

I don't know why I am having such a hard time with this, but in this picture, there are a count of 7 sales (counted in red). Where '13' is circled in red; I need that number to be 7. I have tried all differnt methods of fields on the rows, columns, and values. Anyone know a simple solution to this? Basically I am needing a matrix that just counts the amount of sales for each site. This one has seven, but I can't get it to count on the other column where '13' is.

WuchaDoin_0-1665169793506.png

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @WuchaDoin 

 

You can try the following methods.

Measure = IF(HASONEVALUE('Table'[ITEM]),COUNT('Table'[ITEM]),DISTINCTCOUNT('Table'[ITEM]))

vzhangti_0-1665568476825.png

IF(HASONEVALUE()) This function controls the output of Total.
 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @WuchaDoin 

 

You can try the following methods.

Measure = IF(HASONEVALUE('Table'[ITEM]),COUNT('Table'[ITEM]),DISTINCTCOUNT('Table'[ITEM]))

vzhangti_0-1665568476825.png

IF(HASONEVALUE()) This function controls the output of Total.
 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so very much. I appreciate the help from everyone else, but this is exactly what I needed and now I can even study the line of code you used to better understand DAX at a simpiler level.

Greg_Deckler
Community Champion
Community Champion

@WuchaDoin Ding ding ding! Yet another measure totals problem most likely.

Please vote for this idea: Microsoft Idea (powerbi.com)

 

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

 

This might help as well: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community

BrainPowerBI.jpg

 



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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.