Forum Discussion

poojithas's avatar
poojithas
Icon for Helper III rankHelper III
3 years ago
Solved

Incorrect Totals when using measure in table

Hi All,

I am using a measure with the below formula in my table.

When I use this measure in a table, I am getting incorrect totals. The expected total is 1164 but I get 1160.

I tried using a calculated column instead of a calculated measure, but the results are still inacurate.

Could someone please assist on this.

Thank you,

Poojitha

 

4 Replies

  • tackytechtom's avatar
    tackytechtom
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hi poojithas ,

     

    Here a an example which might give you an idea on why your total differs from the expected outcome:

     

     

    On the left, a table where each block has a different value. In total there are 4 different values (1, 2, 3, 4), but when grouping by block and using a DISTINCTCOUNT on "Value", we can see that each block might have a different number of distinct values, i.e. California has 3 (1, 2, 3) while Florida has 2 (1, 2). The total itself does not sum over what is shown above in the table above but instead calculates the Measure without applying a filter. This means it total just returns all distinct values, that is 4 (1, 2, 3, 4).

     

    Let me know if this helps 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

     

     

  • This is fixed using the below logic:
    =sumx(values(locn),measure2)