Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi community,
I have a table with two columns as shown below.
I would like to concatenate the distinct Product values considering the products with higher ID (id DESC). Separated by comma, same as the example below
| Smartphone,Cable,Tshirt,TV |
File is HERE.
Thanks,
Bruno Monteiro
Solved! Go to Solution.
| 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! |
| 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 @Anonymous ,
have solved in power query:
let
Source = Csv.Document(File.Contents("C:\Users\Avi\OneDrive\Desktop\nba data\data.csv"),[Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Product", type text}, {"id", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Product"}, {{"Max Id", each List.Max([id]), type nullable number}}),
#"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Max Id", Order.Descending}}),
#"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"Max Id"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
#"Merged Columns" = Table.CombineColumns(#"Transposed Table",{"Column1", "Column2", "Column3", "Column4"},Combiner.CombineTextByDelimiter(",", QuoteStyle.None),"Merged")
in
#"Merged Columns"
Please mark this solution as accepted if it resolves the query.
Appreciate a thumbs up if this helped.
Alternatively with DAX:
Step1.
Create a table:
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!