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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Matrix values doesn't add up

Hello,
I've a matrix

justoneusername_0-1718292801669.png

with one column containing Name and one column with values Agile, Bold, Engaged, Not, Smart.
The total of distinct count names is 159, but the number doesn't add.
I have multiple rows per each person.

Smart+ Bold+Engaged+Smart+Not = 159 but I can't manage to find the right one numbers.


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @Kaviraj11 , please allow me to provide another insight: 

Hi  @Anonymous ,

Are you referring to the incorrect total row calculation? You can consider using the IF() + HASONEVALUE() function to determine if it’s a total. If it is, you can perform calculations based on your requirements, such as average, sum, etc.

Measure =
var _table=
SUMMARIZE('Table',[Name],"Value",[Count])
return
IF(
    HASONEVALUE('Table'[Name]),[Count],SUMX(_table,[Value]))

 

vyangliumsft_0-1718334149403.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from @Kaviraj11 , please allow me to provide another insight: 

Hi  @Anonymous ,

Are you referring to the incorrect total row calculation? You can consider using the IF() + HASONEVALUE() function to determine if it’s a total. If it is, you can perform calculations based on your requirements, such as average, sum, etc.

Measure =
var _table=
SUMMARIZE('Table',[Name],"Value",[Count])
return
IF(
    HASONEVALUE('Table'[Name]),[Count],SUMX(_table,[Value]))

 

vyangliumsft_0-1718334149403.png

 

Best Regards,

Liu Yang

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

 

Kaviraj11
Super User
Super User

Hi,

 

if you’re trying to get the correct total for distinct counts across multiple rows per person, you might encounter issues because the distinct count in the total row doesn’t simply add up the individual distinct counts from each category. Instead, it calculates the distinct count across the entire dataset.

 

Create Measure 

Total Distinct Names =
SUMX(
VALUES('Table'[Name]),
CALCULATE(
DISTINCTCOUNT('Table'[Name]),
FILTER(
ALL('Table'),
'Table'[Attribute] IN {"Agile", "Bold", "Engaged", "Not", "Smart"}
)
)
)

 

Solved: DISTINCTCOUNT Total not correct - Microsoft Fabric Community

 

 




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

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors