Forum Discussion
How to use distinctcount for multiple columns - DAX
- 4 years ago
Hi DavidNunes7
You can try this measure
Measure = COUNTROWS ( DISTINCT ( UNION ( DISTINCT ( 'Table'[Date1] ), DISTINCT ( 'Table'[Date2] ), DISTINCT ( 'Table'[Date3] ), DISTINCT ( 'Table'[Date4] ) ) ) )Note that this also counts the blank value. You could substract 1 from it if you don't want to count blank.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi DavidNunes7 ,
If you created the above table using DAX then you can't see it in Power Query Editor as it shows only the data that is loaded to Power BI along with any transformations done within the same area.
Anything that is calculated using DAX is something done on top of the Power Query area.
To get the distinct count of the column values, you can simply write a DAX measure. For example for one of your columns:
DistintCountCol1 =
DISTINCTCOUNT ( yourTablname[yourColumnName] )
Replace yourTablename and yourColumnName with relevant names in your case.