I want to include a new measure using a DAX formula in a Pivot Table. I have the following DAX formula to count unique values in Column1
= DISTINCTCOUNT(Table1[Column1])
How can I COUNT() values equal to "XYZ" and DISTINCTCOUNT() values different than "XYZ". I've tried something like this but is not working.
=IF(Table1[Column1] <> "XYZ",
DISTINCTCOUNT(Table1[Column1]),
COUNT(Table1[Column1])
Sample Input
+----+---------+---------+
| Id | Column1 | Column2 |
+----+---------+---------+
| 1 | ABC | A |
+----+---------+---------+
| 1 | DEF | A |
+----+---------+---------+
| 1 | GHI | B |
+----+---------+---------+
| 1 | ABC | A |
+----+---------+---------+
| 1 | IIU | XYZ |
+----+---------+---------+
| 1 | HYW | A |
+----+---------+---------+
| 1 | ABC | A |
+----+---------+---------+
| 1 | ABC | B |
+----+---------+---------+
| 1 | WQW | XYZ |
+----+---------+---------+
| 1 | ABC | A |
+----+---------+---------+
| 1 | RTT | XYZ |
+----+---------+---------+
| 1 | PPO | XYZ |
+----+---------+---------+
Output I'm looking for:
+----+---+---+-----+
| ID | A | B | XYZ |
+----+---+---+-----+
| 1 | 3 | 2 | 4 |
+----+---+---+-----+