I have a distinctcount in a PowerPivot on a column "Pers ID". I would like to add a condition on this distinct count: only DistinctCount when in Column "Month" the month is later or equal to November (example). I tried to look for a solution on the forum and came out with this:
CALCULATE(DISTINCTCOUNT('Alles 24_07_21'[Pers_ID]);'Alles 24_07_21'[Month_N]>=11)
If I try this I get the following error message:
Calculation error in measure 'Alles 24_07_21'[Distinct Count]: DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
I hope somebody can help me out. Does this formula makes any sense in the first place? What can I do to avoid the error? Column "Pers ID" is formatted in the source file as a number and Month as a number a well.
Pers_ID | Month_N |
---|---|
643328 | 11 |
643329 | 11 |
643328 | 10 |
643329 | 12 |
For example...in the table above, the DistinctCount should be 0 for Pers_ID number "643328" because it has a Month_N < 11. The DistinctCount for Pers_ID "643328" should be 1 because it has Month_N >= 11. I also have a few filters on the Pivot Table but I don't think that is a problem.
Thx a lot in advance!
Best regards,
Nick
Month_N
is integer? – smpa01