Forum Discussion
Rankx ignoring 1 column
- 1 year ago
You're right Arnault_ , I just updated the measure:
Product ranking (volumes moy. stockés) = VAR fx = [Volumes moy. stockés] RETURN IF ( fx = 0, BLANK (), RANKX ( ALL ( XN_ART_DEPOT[ART/VER], XN_ART_DEPOT[Dubai_stock] ), [Volumes moy. stockés], , DESC ) ) - 1 year ago
Hi All,
I finally figured this out. Here is the correct formula:
Product ranking (volumes moy. stockés) v 3 = VAR fx = [Volumes moy. stockés] RETURN IF ( fx = 0, BLANK (), RANKX ( ALLSELECTED ( XN_ART_DEPOT[ART/VER], XN_ART_DEPOT[Dubai_stock] ), [Volumes moy. stockés],, DESC ) )Thank you for your help.
Hi Bibiano_Geraldo ,
In the revised formula, you don't remove XN_ART_DEPOT[Dubai_stock], then it goes back to my initial result. I will try to figure this out. I am not sure the sample data would be usable because my measure calls a formula from another table. But anyway, I think you for your help.
You're right Arnault_ , I just updated the measure:
Product ranking (volumes moy. stockés) =
VAR fx = [Volumes moy. stockés]
RETURN
IF (
fx = 0,
BLANK (),
RANKX (
ALL ( XN_ART_DEPOT[ART/VER], XN_ART_DEPOT[Dubai_stock] ),
[Volumes moy. stockés],
,
DESC
)
)- Arnault_1 year agoResolver III
Hey Bibiano_Geraldo ,
I also found a solution by using ALLSELECTED, but applying the same logic. Which solution you recommand to use? Mine or yours?
- Bibiano_Geraldo1 year agoSuper User
Hi Arnault_, It depend on your logic:
Using ALL: This approach ensures that the ranking is calculated by ignoring the “Dubai_stock” column entirely. It is straightforward and effective if you want to exclude specific columns from the ranking calculation.
Using ALLSELECTED: This approach respects the current context and filters applied to the data, which can be useful if you want the ranking to be dynamic based on user selections in the report. It can be more flexible in interactive reports where users might apply different filters.
If your report requires dynamic interaction and you want the ranking to adjust based on user selections, go with ALLSELECTED. If you need a static ranking that ignores specific columns, use ALL.- Arnault_1 year agoResolver III
Thanks that's extremely useful !!! I will follow your advise.