Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'd like to create a calculated column that show the decending ranking of the column name based on the column values as shown in the "Rank by Code" column.
I can resolve this case by using "SORTBY" and "CONCATNATE" function in excel but I don't know how to write the DAX formula to sort the column name in Power BI.
Would you please suggest the DAX formula to achieve this task?
Thanks!
Solved! Go to Solution.
Hi , @RitaP_123
It can be realized in Power Query Editor .
Here are the steps you can refer to :
(1)My test data is the same as yours.
(2)We can click "Custom Column" in "Add Column" tab:
(3)We can enter this M language:
Text.Combine(Table.Sort(Record.ToTable(_),{"Value",1})[Name])
(4)Then we can meet your need , the result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @RitaP_123
It can be realized in Power Query Editor .
Here are the steps you can refer to :
(1)My test data is the same as yours.
(2)We can click "Custom Column" in "Add Column" tab:
(3)We can enter this M language:
Text.Combine(Table.Sort(Record.ToTable(_),{"Value",1})[Name])
(4)Then we can meet your need , the result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@RitaP_123 Also, if you and an Index and then unpivot your A,B,C,D columns you can do this:
Rank by Code Measure = CONCATENATEX('Table2',[Attribute],,[Value],DESC)
PBIX is attached beneath signature that shows both ways.
@RitaP_123 Try:
Rank by Code Column =
VAR __Table = { ("A",[A]), ("B",[B]), ("C",[C]), ("D",[D]) }
RETURN
CONCATENATEX(__Table,[Value1],,[Value2],DESC)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |