Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all
I am trying on Power Query to go from this:
To this:
The only problem I have is that as seen above on column count, is duplicating me the values. How can I have distinct ones only?
Here is the M code:
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"Count", each Text.Combine ([Sub Region],", "), type text}})
in
#"Grouped Rows"
Thanks!
Solved! Go to Solution.
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"Count", each Text.Combine(List.Distinct([Sub Region]),", "), type text}})
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"SR", each Text.Combine(List.Distinct([Sub Region]),", ")}, {"R", each Text.Combine(List.Distinct([Region]),", ")}, {"C", each Text.Combine(List.Distinct([Country]),", ")}})
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL question.
Is it possible to have more than one column?
In our solution we just have Sub region:
Can I have also region and country?
Could I try for example in the code:
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"Count", each Text.Combine(List.Distinct([Sub Region]),List.Distinct([Region],List.Distinct([Country])),", "), type text}}),
?
Thanks!
@CNENFRNL question.
Is it possible to have more than one column?
In our solution we just have Sub region:
Can I have also region and country?
Could I try for example in the code:
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"Count", each Text.Combine(List.Distinct([Sub Region]),List.Distinct([Region],List.Distinct([Country])),", "), type text}}),
?
Thanks!
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"SR", each Text.Combine(List.Distinct([Sub Region]),", ")}, {"R", each Text.Combine(List.Distinct([Region]),", ")}, {"C", each Text.Combine(List.Distinct([Country]),", ")}})
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @CNENFRNL
I got the following error:
Could it be because of the renamed columns below?
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"SR", each Text.Combine(List.Distinct([Sub Region]),", ")}, {"R", each Text.Combine(List.Distinct([Region]),", ")}, {"C", each Text.Combine(List.Distinct([Country]),", ")}}),
#"Renamed Columns" = Table.RenameColumns(#"Grouped Rows",{{"Count", "Sub Region"}})
in
#"Renamed Columns"
Thanks!
It worked!! @CNENFRNL
I changed it to:
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"SR", each Text.Combine(List.Distinct([Sub Region]),", ")}, {"R", each Text.Combine(List.Distinct([Region]),", ")}, {"C", each Text.Combine(List.Distinct([Country]),", ")}})
in
#"Grouped Rows"
Thanks a million!!
#"Grouped Rows" = Table.Group(#"Changed Type", {"Id"}, {{"Count", each Text.Combine(List.Distinct([Sub Region]),", "), type text}})
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |