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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I'd like to be able to sort first by the number then by employee name. Is there a way to do this like we do in excel - setting up rules of sorting?
Solved! Go to Solution.
Hi,
On your Table.Matrix visual, click on the number column, press the Shift key and then click on the Employee name column.
Hi @jcastr02 ,
Final value to be ranked =
Rank on Primary Measure (ascending)
+ Rank on Secondary Measure (ascending) / (Total Row Count + 1)
The first term is the Primary Measure rank, and the second term is the Secondary Measure rank scaled to be between 0 and 1 so that it can break ties in the Primary Measure rank.
In DAX, assuming you have two measures, [Primary Measure] and [Secondary Measure], to be ranked over all rows of Table:
Final Rank =
RANKX (
ALL ( Table ),
RANKX ( ALL ( Table ), [Primary Measure],, ASC )
+ DIVIDE (
RANKX ( ALL ( Table ), [Secondary Measure],, ASC ),
( COUNTROWS ( ALL ( Table ) ) + 1 )
)
)
Just replace with your table/measure names and it should work.
And a similar case refer(sort by a measure ,if with the same value ,then sort by another value) :https://community.powerbi.com/t5/Desktop/RANKX-with-duplicate-values/m-p/2072218#M772408
Best Regaards
Lucien
Hi,
On your Table.Matrix visual, click on the number column, press the Shift key and then click on the Employee name column.
@jcastr02 I don't believe that is a function quite yet of table and matrix visuals but you could create a composite key in Power Query to just concatenate the two columns and then use a Sort By column.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 49 | |
| 43 | |
| 36 | |
| 33 | |
| 30 |
| User | Count |
|---|---|
| 138 | |
| 118 | |
| 59 | |
| 59 | |
| 56 |