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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
longtruong
New Member

Incorrect SUM number?

Hello Everyone,

 

I have first tried PowerBI with a very simple query and got incorrect SUM number.

 

PowerBI - Incorrect SUM number.png

 

The correct total must be 373 instead of 318 in the above image.  I am not sure if Count (Distinct) of SAP ID causes this problem.  Can anyone please explain?

 

Thanks,

 

Long

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

There will be a DAX formula that does it but I'm not exactly sure how (I'm new to DAX but not distinct count issues).

At a guess investigating SUMX might be a good start, it should be possible to get that to sum the distinct count for each month.

 

Here's a link to what looks like a similar technique:

 

http://www.powerpivotpro.com/2010/02/sumx-the-5-point-palm-exploding-fxn-technique/

View solution in original post

Try create new key that combine SAPID and MonthID and then do DistinctCount on this new key field

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

If you're using a distinct count then the total won't be a sum of each month it will be another distinct count for all months. IDs that appear in more than one month will be counted only once for the total.

 

e.g.

The values

Month   SAP ID

April      1

April      2

May      1

May      3

 

Would give 2 for April, 2 for May and 3 for the total because while SAP ID 1 appears in both months but is only counted once for the total.

Hello BarneyL,

 

Thanks for your response.  Is there any way to apply distinct count on month but count on total?

 

Regards,

 

Long

Try create new key that combine SAPID and MonthID and then do DistinctCount on this new key field

Hello BarneyL and Tishchenko,

 

Thank you very much for your information.  It really helps.

 

Regards,

 

Long

Anonymous
Not applicable

There will be a DAX formula that does it but I'm not exactly sure how (I'm new to DAX but not distinct count issues).

At a guess investigating SUMX might be a good start, it should be possible to get that to sum the distinct count for each month.

 

Here's a link to what looks like a similar technique:

 

http://www.powerpivotpro.com/2010/02/sumx-the-5-point-palm-exploding-fxn-technique/

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors