Forum Discussion
RankX on a table with multiple filters
- 1 year ago
In the screenshot below I am using the following measures. Notice that evaluated correctly.
Total Revenue ALLDATES 2023 = CALCULATE ( [Total Revenue], FILTER ( ALL ( Dates ), Dates[Year] = 2023 ) ) RANK = RANKX ( ALL ( Category[Category] ), [Total Revenue ALLDATES 2023], , DESC, DENSE )Now, if i add another column, the rank for the column in rankx and the additional column is evaluated differently.
Things to check:
- are you using just the column specified in the rankx measure or are there more columns?
- is the expression the rank is based on returning the correct value?
Hi DK-C-87 ,
To ensure that the ranking is limited to the 21 rows shown in your visual, you can adjust your measure to better respect the current filter context.
Please consider this updated DAX and let me know if its all ok:
Measure =
IF(
HASONEFILTER(ProcesGBS[Proces]),
RANKX(
ALLSELECTED(ProcesGBS[Proces]),
CALCULATE(
SUM(ProcesGBS[Timer Norma RAW CM (ProcesID)]),
FILTER(
ALL(Stamdata),
Stamdata[Plant] <> BLANK()
)
),
,
DESC,
DENSE
),
BLANK()
)
Your measure returns this for me:
Do you have a suggestion to why this is ?
- danextian1 year ago
Super User
Are you using the process column in your viz?
- DK-C-871 year ago
Helper I
You mean my visual 🙂
Yes, I am using the Proces column in my visual - it is the first column in the visual.- danextian1 year ago
Super User
In the screenshot below I am using the following measures. Notice that evaluated correctly.
Total Revenue ALLDATES 2023 = CALCULATE ( [Total Revenue], FILTER ( ALL ( Dates ), Dates[Year] = 2023 ) ) RANK = RANKX ( ALL ( Category[Category] ), [Total Revenue ALLDATES 2023], , DESC, DENSE )Now, if i add another column, the rank for the column in rankx and the additional column is evaluated differently.
Things to check:
- are you using just the column specified in the rankx measure or are there more columns?
- is the expression the rank is based on returning the correct value?
- Bibiano_Geraldo1 year ago
Super User
Can you please share a sample file with no sensitive information?
Your screenshot is not whowing entire table.
You can upload a sample file in onedrive or other cloud and share the link for download here in comments.
- DK-C-871 year ago
Helper I
Sorry, I can't share sample file.
I am filtering on 3 columns and are only showing 1 of these three filtret columns in the visuals table - could it be the problem here ?
Maybe the measure should summarize first and then rank on that ?