Forum Discussion
stribor45
Post Prodigy
2 years agoFrom DAX studio to Power BI DAX code
My code works fine in Dax Studio but when I move it to Power BI I have some trouble with it. Finally, I was able to change it and make it work but now having trouble with ORDER BY. I want to order th...
Dangar332
Resident Rockstar
2 years agoHi, stribor45
Use below
MY TABLE =
VAR T =
SUMMARIZECOLUMNS (
'TABLEA'[COLUMN1],
"REASON", COUNT ( 'TABLEA[COUNT] )
)
VAR X = ADDCOLUMNS (
T, "Ranking",
RANKX (
T, [REASON] ,,asc
)
)
RETURN X
Use Asc or desc as your requirements
And this orderby use in window function like (offset, rank,window)
And this order by use outside of dax query to indicate order of any column or expression.
stribor45
Post Prodigy
2 years agoThe dax code you shared but doesnt order based on REASON or Ranking. I would like this to be ordered by ranking if possible