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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
johnyip
Super User
Super User

Issues with selectable data range of a slicer

Hello all, I have an issue creating a slicer whose selectable values are dynamic based on the data selected.

 

As a brief introduction, the dashboard aims to display the sales figures of different companies based on the year and month (YYYYMM) selected. I deliberately make the sales of Company A and Company C identical for the date-month 202012 as the test case.

 

The Ranking slicer aims to confine the range of selectable values based on the rank of the data displayed by the dashboard. For example, in 202012, the slicer is supposed to allow users to slide from the values of 1 to 4 only (because two companies ranks the same).

 

The DAX I used to confine the values available in the Ranking slicer is as follows:

Ranking_SLICER FILTER =
VAR MinValue = MINX(ALLSELECTED(Sales[Company]),RANKX(ALLSELECTED(Sales[Company]),[Monthly Sales],,DESC,DENSE))
VAR MaxValue = MAXX(ALLSELECTED(Sales[Company]),RANKX(ALLSELECTED(Sales[Company]),[Monthly Sales],,DESC,DENSE))
VAR CurrentSlicerValue = SELECTEDVALUE('Ranking range'[Ranking])
RETURN
IF(CurrentSlicerValue >= MinValue && CurrentSlicerValue <= MaxValue,1,0)

 

 
The logic is totally perfect but it just fails to work.
 
Ironically, when I hardcode the selected date in [Monthly Sales] as 
CALCULATE(SUM(Sales[Sales]),Sales[Date]=202012), the Ranking filter can confine the values correctly, but the [Monthly Sales] is then not listened to the slicer, which is totally not preferred.
 
When I mean to make the [Monthly Sales] listen to the date slicer, I use this DAX: 
CALCULATE(SUM(Sales[Sales]),Sales[Date]=SELECTEDVALUE('Time filter'[Date])), but this renders the Ranking slicer confines the user to slide through the range of 1 to 1 only, failing to comply with the logic I defined.

 

So, is there any workaround for this issue? I tried using different tricks but it just won't work. I will be very glad if I can seek an answer here. Thanks a lot.

 

The download link of my file:

https://drive.google.com/file/d/1xh-rd9MYf4RqYrt6tDCfaQGSKzBhWaKB/view?usp=sharing



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!
1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @johnyip ,

 

This issue has been confirmed as a known issue internally. Internal ICM ID: 282363959

Please be patient to wait for fixing. If there is any news, I will update it here.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @johnyip ,

 

Please try to click your Date slicer and then use Edit interaction function to change the interactions from None to Filter. Then rank slicer works.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-rzhou-msft
Community Support
Community Support

Hi @johnyip ,

 

This issue has been confirmed as a known issue internally. Internal ICM ID: 282363959

Please be patient to wait for fixing. If there is any news, I will update it here.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-rzhou-msft
Community Support
Community Support

Hi @johnyip ,

 

I think your measure is correct. I suggest you to use list kind slicer directly. There may be something wrong in Slicer between function. Or you can create two list kind slicer , one show min value you need and another one you select max value you need.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.