Forum Discussion
Abhaykumar
10 years agoMicrosoft Employee
Getting distinct values for multiple columns
Is there a way to get distinct values for multiple columns? Specifically, I want to replicate the following SQL query into PowerBI to create a new table: SELECT DISTINCT Col1, Col2, Col3 FROM Tab...
- 10 years ago
- 10 years ago
Hi Abhaykumar,
Use DAX and in DAX the function SUMMARIZE().
Summarize will pull out distinct values from columns.
So your resultset will be new table from Summarize
Table_Output = Summarize(Table_IN,Col1,Col2,Col3)
I hope it helps !
BR,
Achin
ImkeF
10 years agoCommunity Champion
Sorry, should have mentioned that you need to add this column in the query editor, it's M-code.
Abhaykumar
10 years agoMicrosoft Employee
I tried to create a custom column using Query Editor. The column gets created as a List but gives error when expanded.
Let me know if i am doing something wrong.