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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
MEFOX
Helper III
Helper III

Total incorrect

I'm using the table visual. I've turned on Totals in the Format section and I get a Total that is incorrect. The Total should be 584. Can someone give me some ideas of what might cause this. Is there another way to get the total at the bottom of a table? 

 

Registered = DISTINCTCOUNTNOBLANK('CRM FactEvents'[ContactID])
ContactID is a column in the CRM FactEvents table.

 

MEFOX_0-1643387417267.png

 

 

Thanks for the help.

6 REPLIES 6
Anonymous
Not applicable

Hi @MEFOX 

Please try this formula :

 

Measure = CALCULATE(COUNT('CRM FactEvents'[ContactID]),FILTER('CRM FactEvents','CRM FactEvents'[ContactID]<>BLANK()))

 

Best Regard

Community Support Team _ Ailsa Tao

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

jdbuchanan71
Super User
Super User

@MEFOX 

You need to use something other than DISTINCTCOUNT because it is giving you the correct answer, the same Contact ID is in several days so in the total each DISTCINT countact id only gets counted once .  You should us COUNTROWS.

Unfortunately I'm not having much luck with the COUNTROWS function. Are you aware of another visual (maybe a marketplace visual) that might sum the rows in the visual instead of the data behind the visual?

jdbuchanan71
Super User
Super User

@MEFOX That total just means that some [ContactID] are in more than 1 [Type] so in the total they only get counted once (DISTINCTCOUNTNOBLANK).  Try it with a SUMX over the [Type].

Registered =
SUMX (
    VALUES ( 'CRM FactEvents'[Type] ),
    CALCULATE ( DISTINCTCOUNTNOBLANK ( 'CRM FactEvents'[ContactID] ) )
)

Your solution works when there is just Type and Registered in the table but when I add the date column it no longer provides the correct Total.

 

MEFOX_1-1643405362750.png

 

 

This seems to work for the Type column but I need to add additional columns from another table to the Values clause. I can't seem to get the syntax for that correct. Are you able to provide the syntax for that ?

Helpful resources

Announcements
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.