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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Incorrect totals in Table View when using DISTINCTCOUNT Function power BI desktop

Hello,

Total is reflecting incorrect in table view when using DISTINCTCOUNT function in DAX.

Test1 = DISTINCTCOUNT('Participants'[ Participant Id])

 

amty63_0-1618756578805.png

 

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

Hi @Anonymous ,

You could create a new measure:

test2 = IF(HASONEVALUE('Participants'[COUNTRY_DESCR]),[Test1], SUMX(ALL('Participants'),'Participants'[Test1]))

 

final you will see the below:

v-luwang-msft_0-1618884851928.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

You could create a new measure:

test2 = IF(HASONEVALUE('Participants'[COUNTRY_DESCR]),[Test1], SUMX(ALL('Participants'),'Participants'[Test1]))

 

final you will see the below:

v-luwang-msft_0-1618884851928.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

jdbuchanan71
Super User
Super User

@Anonymous 

The total row in a visual showing a DISTINCTCOUNT does not add up the rows above.  I caluclates the DISTINCTCOUNT without any filter applied to the country_descr.  You must also have some other filters / slicers that are feeding into that visual.  
If you want the total to add up by country you can do something like this.

Participants by country =
SUMX (
    VALUES ( TableName[COUNTRY_DESCR] ),
    CALCULATE ( DISTINCTCOUNT ( 'Participants'[ Participant Id] ) )
)

You will need to change the 'TableName' to match whatever table your [COUNTRY_DESCR] is in.

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.