Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I have date table with 3 yrs of data.When I want to bring the date to slicer I should see only 2 yrs of data. For eg slicer should show 2022 and 2021. Next year it should be 2023 and 2022. It should not be hard-coded in filters.
Automatically only 2 yrs value should be shown in slicer
Can we bring this in measure?
Any help is much appreciated
Solved! Go to Solution.
Hi,
Thank you for your feedback.
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
One of ways is to apply calculated column to report level filter pane.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
one of ways to achieve this is to create a measure something like below, and put it into Visual Filter pane and set it up like below.
Please also check the attached pbix file.
Last two years measure: =
VAR _currentyear =
YEAR ( TODAY () )
VAR _previousyear = _currentyear - 1
RETURN
IF (
SELECTEDVALUE ( 'Year'[Year] ) = _currentyear
|| SELECTEDVALUE ( 'Year'[Year] ) = _previousyear,
1,
0
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you so much.But when I try to apply this measure for all pages I could not bring the measure to filter on all pages. Is there any other way to do it?
Hi,
Thank you for your feedback.
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
One of ways is to apply calculated column to report level filter pane.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
22 | |
14 | |
11 | |
9 | |
6 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |