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
jlarques
Helper V
Helper V

Total wrong in columns

Hi everyone,

 

I developed a measure that counts the number of users with sanctions accumulated, but on the matrix, the total is wrong, as you can see in the image below.

 

The measure is:

Error column=CALCULATE(DISTINCTCOUNT(Sanctions[Userid]);DATESYTD(CALENDARIO[Date]))
 

The result is:

Value A    30

Value B    21

Value C      6

Value D     1

Total:       52

 

Any ideas about how to solve it?

Thanks to everyone for all your help!

Regards,

 

José Luis 

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

To solve this, you can use a different approach to calculate the totals correctly. One common method is to use a SUMX function that iterates over each row and sums up the distinct counts individually.

Here's an adjusted measure to get the correct total:

 

Error column =
SUMX(
SUMMARIZE(
Sanctions,
Sanctions[Userid],
"DistinctCount", DISTINCTCOUNT(Sanctions[Userid])
),
[DistinctCount]
)

View solution in original post

1 REPLY 1
technolog
Super User
Super User

To solve this, you can use a different approach to calculate the totals correctly. One common method is to use a SUMX function that iterates over each row and sums up the distinct counts individually.

Here's an adjusted measure to get the correct total:

 

Error column =
SUMX(
SUMMARIZE(
Sanctions,
Sanctions[Userid],
"DistinctCount", DISTINCTCOUNT(Sanctions[Userid])
),
[DistinctCount]
)

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.