Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Power_MN
Helper I
Helper I

RANKX with Time Slicer (between)

Hello everybody, i'm facing a problem with the RANKX funktion and slicers. The functions works absolutely fine with dropdown slicers (Year, Month, Week). But if want to use the "between slicer", the function do not work anymore. Rank = RANKX(ALLSELECTED(Data[Product]),[Score],,DESC) Has anyone had the same problem and knows a solution? Kind regards
2 REPLIES 2
amitchandak
Super User
Super User

@Power_MN , This should work with both. are you using some date context in score ?

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak it is difficult to share a example, because the dataset is very complicated with many joins and sensitive information etc. Maybe you can check the measure of "score", if there is something wrong. Otherwise I have to prepare some samples of the data. Here is the measure for the "score". The "score" is a classic weighted scoring model. The measure refers to one table. Score = -- definition weighting -- VAR price = 40 VAR punctuality = 25 VAR claim = 25 VAR goal = 10 -- Points for punctuality -- VAR points_of_punctuality = ([Average punctuality]*100)/ (CALCULATE (SUMX (VALUES(Data[Name]),[Average punctuality]), ALLSELECTED(Data) ) ) -- Points for claim -- VAR points_of_claim = (([Average claim])*100)/ ( ( (CALCULATE (SUMX (VALUES(Data[Name]),[Average claim]), ALLSELECTED(Data) ) ) ) ) -- Points for goal -- VAR points_of_goal = IF(Data[goal]<=7,100,50) -- Points for price -- VAR points_of_price = IF (CALCULATE (DISTINCTCOUNT(Data[Name])=1 && [Average price]<0, ALL(Data[Name]) ),100, IF(CALCULATE (DISTINCTCOUNT(Data[Name])=1 && [Average price]>0, ALL(Data[Name]) ),0, ([Average price]-[Max price])/(([Max price]-[Min price)/100)*(-1) ) ) -- Final Score with weighting -- VAR Final_Score = points_of_price*price+points_of_claim*claim+points_of_punctuality*punctuality+points_of_goal*goal RETURN Final_Score Thank you very much for your support!! Kind regards

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors