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 ,
Thanks you very much for you help, unfortunately, it does not work. The rank is now "1" for all the products.
Hi Arnault_ ,
Please try the bellow Updated DAX, if the problem persist, consider to share no sensitive data sample:
Product ranking (volumes moy. stockés) =
VAR fx = [Volumes moy. stockés]
RETURN
IF (
fx = 0,
BLANK(),
RANKX (
FILTER (
ALL ( XN_ART_DEPOT[ART/VER] ), -- Ignore filter on ART/VER
NOT ( ISBLANK ( [Volumes moy. stockés] ) ) -- Ensure non-blank values
),
[Volumes moy. stockés],,
DESC
)
)- Arnault_1 year agoResolver III
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.
- Bibiano_Geraldo1 year agoSuper User
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?