Forum Discussion

longtruong's avatar
longtruong
New Member
11 years ago
Solved

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

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

5 Replies

  • Anonymous's avatar
    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.

    • longtruong's avatar
      longtruong
      New Member

      Hello BarneyL,

       

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

       

      Regards,

       

      Long