Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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 the X table by ranking. Can someone help with this please. Also why on some pages it is ORDERBY but somewhere it is ORDER BY.
https://dax.guide/st/order-by/
MY TABLE =
VAR T =
SUMMARIZECOLUMNS (
'TABLEA'[COLUMN1],
"REASON", COUNT ( 'TABLEA[COUNT] )
)
VAR X = ADDCOLUMNS (
T, "Ranking",
RANKX (
T, [REASON]
)
)
RETURN X
Solved! Go to Solution.
I had this same problem while back and posted the question here
Leason learned 🙂 look at your previous posts 🙂
I had this same problem while back and posted the question here
Leason learned 🙂 look at your previous posts 🙂
Hi, @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.
The dax code you shared but doesnt order based on REASON or Ranking. I would like this to be ordered by ranking if possible
Yes i tried that but didnt work for me either.
VAR X = ADDCOLUMNS(T, "Ranking",RANK (DENSE, T, ORDERBY ([REASON], ASC)))
User | Count |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |