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! Get ahead of the game and start preparing now! Learn more
OK, because your table was created with DAX I had to modify this code to add the SortOrder column when the table was created
VAR tbl = {(t_rev, 1), (t_cogs, 2), (t_oth, 3) , (t_exp, 4)}
So now you can set the SortOrder in Model view for REV&COGS - I've already done it in the attached PBIX file.
Regards
Phil
Proud to be a Super User!
Hi Paul,
Sorry, slight modification here.
In Power Query create a new column called SortOrder in the table with this code
if [REV&COGS] = "REV" then 1 else if [REV&COGS] = "COGS" then 2 else if [REV&COGS] = "OTH" then 3 else 4
Which gives you this in the Data Model when you Close & Apply
Then in the Model view click on the REV&COGS column and set the Sort by Column to SortOrder
Regards
Phil
Proud to be a Super User!
thank you very much , i have add the expression for Sort , also set sort at model table , but the table still not yet sort.
Below my PBI file :-
I get error when i try to sort :-
Paul
Hi Paul,
Sorry I made a mistake in the initial answer. Check above for the correction.
regards
Phil
Proud to be a Super User!
Hi Phil
Very sorry , now i get more error.
Can you pls share with me the PBI file.
Paul Yeo
OK, because your table was created with DAX I had to modify this code to add the SortOrder column when the table was created
VAR tbl = {(t_rev, 1), (t_cogs, 2), (t_oth, 3) , (t_exp, 4)}
So now you can set the SortOrder in Model view for REV&COGS - I've already done it in the attached PBIX file.
Regards
Phil
Proud to be a Super User!
In power query, you can add an index column and then sort the visual.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |