Forum Discussion
isThisABug
6 years agoFrequent Visitor
Calculated column analysis
Hello everyone, I wante to post this in order to improve my skills and get a better understanding of Power BI. The problem I solved is create a calculated column that concatenates other columns t...
Greg_Deckler
6 years agoCommunity Champion
Oh yeah, duh, forgot CONCATENATEX has an order by expression:
Sort 3 =
VAR __Table = { [Product 1], [Product 2], [Product 3], [Product 4], [Product 5] }
RETURN
CONCATENATEX(__Table,[Value],",",[Value],ASC)
Or, in a single line:
Sort 4 = CONCATENATEX({ [Product 1], [Product 2], [Product 3], [Product 4], [Product 5] },[Value],",",[Value],ASC)
Anonymous I'm not sure why a single line of DAX code is a square peg. I mean, you could possibly do it in a single line of M code, but I don't see that being any better than a single line of DAX code.
Greg_Deckler
6 years agoCommunity Champion
Here is the M code:
Text.Combine( List.Sort({[Product 1], [Product 2], [Product 3], [Product 4], [Product 5]} ),"," )
M requires 2 functions to do what DAX can do in 1 function. Just, just pointing that out... 🙂 I suppose one of them is a square peg...