Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I need this measure to give me a ranking from 1-21 in my visual, which it dosen't do at the moment
Measure =
IF(HASONEFILTER(ProcesGBS[Proces]),
RANKX(ALLSELECTED(ProcesGBS),
CALCULATE(SUM(ProcesGBS[Timer Norma RAW CM (ProcesID)]),
FILTER(ALL(Stamdata), Stamdata[Plant] <> BLANK()))),
BLANK()
)My table visual
I'm using ALLSELECTED because I have multiple filters set up specific for this table visual.
The table only shows these 21 rows in the visual, but it looks like the rankx measure catches more and therefore gets me as much as ranking 1730
Can anyone crack this mistory ?
Solved! Go to Solution.
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:
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 ?
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.
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 ?
Are you using the process column in your viz?
You mean my visual 🙂
Yes, I am using the Proces column in my visual - it is the first column in the visual.
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:
Things to check:
Here's a refined measure that you can use:
Measure =
IF(
HASONEFILTER(ProcesGBS[Proces]),
RANKX(
FILTER(
ALLSELECTED(ProcesGBS),
NOT(ISBLANK(SUM(ProcesGBS[Timer Norma RAW CM (ProcesID)])))
),
CALCULATE(
SUM(ProcesGBS[Timer Norma RAW CM (ProcesID)]),
FILTER(ALL(Stamdata), Stamdata[Plant] <> BLANK())
),
,
DESC,
DENSE
),
BLANK()
)
Let me know if you have any further questions or need additional adjustments!
💌 If this helped, a Kudos 👍 or Solution mark ✅ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Your measure returns this for me :
A small different, but still not solved - do you have a suggestion ?
Hi @DK-C-87
The rank is calculated in the context of other selected rows in the ALLSELECTED(ProcesGBS) table. Rank is supposed to be applied to a column and not a table.
If I change the allselected to a column like this :
IF(HASONEFILTER(ProcesGBS[Proces]),
RANKX(ALLSELECTED(ProcesGBS[Proces]),
CALCULATE(SUM(ProcesGBS[Timer Norma RAW CM (ProcesID)]),
FILTER(ALL(Stamdata), Stamdata[Plant] <> BLANK()))),
BLANK()
)
Then I get this result :
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |