Forum Discussion

jlarques's avatar
jlarques
Helper V
6 years ago
Solved

Total wrong in columns

Hi everyone,   I developed a measure that counts the number of users with sanctions accumulated, but on the matrix, the total is wrong, as you can see in the image below.   The measure is: Erro...
  • technolog's avatar
    2 years ago

    To solve this, you can use a different approach to calculate the totals correctly. One common method is to use a SUMX function that iterates over each row and sums up the distinct counts individually.

    Here's an adjusted measure to get the correct total:

     

    Error column =
    SUMX(
    SUMMARIZE(
    Sanctions,
    Sanctions[Userid],
    "DistinctCount", DISTINCTCOUNT(Sanctions[Userid])
    ),
    [DistinctCount]
    )