Forum Discussion

cheid_4838's avatar
cheid_4838
Icon for Helper IV rankHelper IV
1 year ago
Solved

Countdistinct is not Summing correctly

I've created the below logic (Total Cal Days) to count distinct the number of calendar days and then put the sum of those values as the total.  I am exepecting the total to be 32, not 2 (see screensh...
  • rajendraongole1's avatar
    1 year ago

    Hi cheid_4838  - You're summarizing the entire CalendarLookup table without any grouping columns. This means it returns a single row, and the count becomes the total number of dates in the current filter context.

    try below calculation :

    Total Cal Days =
    SUMX(
    VALUES('YourTable'[GroupColumn]), -- e.g., TractorID
    CALCULATE(DISTINCTCOUNT('CalendarLookup'[Date]))
    )

     

    Hope this works. please check and let know.