Forum Discussion
Need help with Slicer/Filter/Selectedvalue
Hi,
Can you pls help me set up a month drop-down slicer or a date parameter that can:
- Filter that month for some visuals
- Filter that month and previous 11 months for other visuals
I tried Selectedvalue but the way I set up must be wrong so it didn't work. Please help. Thank you
Hi Zoeynguyen
You can solve it by creating two separate measures — one that only respects the month selected in the slicer, and another that calculates the selected month plus the previous 11 months.For example for selected month a standart measure like :
Total Revenue=SUM ( Data[Revenue] )Revenue (Selected + Last 11 Months) =
VAR EndDate = EOMONTH( MAX('Dates'[Date]), 0 )
VAR StartDate = EOMONTH( EndDate, -11 )
RETURN
CALCULATE(
[Total Revenue],
ALL('Dates'),
DATESBETWEEN('Dates'[Date], StartDate, EndDate)
)For the measures Selected month + previous 11 months – thne measures should ignore the visual’s current date filter and apply a relative 12-month window.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
5 Replies
- Ritaf1983Super User
Hi Zoeynguyen
You can solve it by creating two separate measures — one that only respects the month selected in the slicer, and another that calculates the selected month plus the previous 11 months.For example for selected month a standart measure like :
Total Revenue=SUM ( Data[Revenue] )Revenue (Selected + Last 11 Months) =
VAR EndDate = EOMONTH( MAX('Dates'[Date]), 0 )
VAR StartDate = EOMONTH( EndDate, -11 )
RETURN
CALCULATE(
[Total Revenue],
ALL('Dates'),
DATESBETWEEN('Dates'[Date], StartDate, EndDate)
)For the measures Selected month + previous 11 months – thne measures should ignore the visual’s current date filter and apply a relative 12-month window.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- V-yubandi-msftCommunity Support
Hi Zoeynguyen ,
Have you had a chance to try the method suggested by the Ritaf1983. Does it meet your needs, or do you think any changes are still required? If you can, please test it and let me know what results you’re seeing.
Thank you for your response Ritaf1983 .
Best regards,
Yugandhar - V-yubandi-msftCommunity Support
Hi Zoeynguyen ,
If the issue has been resolved, that's good to hear. If you still need any further details or assistance, please don't hesitate to reach out.
Best regards,
Yugandhar
- V-yubandi-msftCommunity Support
Hi Zoeynguyen ,
Has your issue been resolved, or are you still experiencing any problems? Your feedback is valuable to the community and can help others facing similar situations. Please let us know if you have any updates.Thank You.
- ZoeynguyenFrequent Visitor
Hi,
Thank you for your help.
My original post/question was ... not good and clear about what I needed.
However, I found my solution: https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273690