Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a data with month end dates like table below. I need two filters, one is a regular slicer with date column in it. and other filter that contains 3 Months, 6 Months as options to select.
ID | Date |
ABCD | 5/31/2021 |
ABCD | 4/30/2021 |
ABCD | 3/31/2021 |
ABCD | 2/28/2021 |
ABCD | 1/31/2021 |
ABCD | 12/31/2020 |
ABCD | 11/30/2020 |
ABCD | 10/31/2020 |
ABCD | 9/30/2020 |
ABCD | 8/31/2020 |
ABCD | 7/31/2020 |
ABCD | 6/30/2020 |
ABCD | 5/31/2020 |
ABCD | 4/30/2020 |
ABCD | 3/31/2020 |
ABCD | 2/29/2020 |
ABCD | 1/31/2020 |
ABCD | 12/31/2019 |
ABCD | 11/30/2019 |
ABCD | 10/31/2019 |
ABCD | 9/30/2019 |
ABCD | 8/31/2019 |
ABCD | 7/31/2019 |
ABCD | 6/30/2019 |
If 9/30/2019 and 2/28/2021 are selected as start and end dates on 1st filter/slicer, and 3 months as in second filter, the table visual should show something similar below:
ID | Date |
ABCD | 2/28/2021 |
ABCD | 11/30/2020 |
ABCD | 8/31/2020 |
ABCD | 5/31/2020 |
ABCD | 2/29/2020 |
ABCD | 11/30/2019 |
Please help me achieve his. Thanks in advance.
Solved! Go to Solution.
Hi @mysasai ,
Try this:
Measure =
VAR SelectedMonthInterval_ =
SELECTEDVALUE ( 'Month Interval'[Month Interval] )
VAR Rank_ =
RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
DESC,
DENSE
)
VAR Mod_ =
MOD ( Rank_, SelectedMonthInterval_ )
RETURN
IF ( Mod_ = 1, 1 )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mysasai ,
Try this:
Measure =
VAR SelectedMonthInterval_ =
SELECTEDVALUE ( 'Month Interval'[Month Interval] )
VAR Rank_ =
RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
DESC,
DENSE
)
VAR Mod_ =
MOD ( Rank_, SelectedMonthInterval_ )
RETURN
IF ( Mod_ = 1, 1 )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mysasai , I explained this approch in video from this time onward
https://youtu.be/44fGGmg9fHI?t=870
Hi @amitchandak,
Appreciate your quick response.
I have gone through your video, it is close to but not exactly what I need.
Could you please tweak the measure code for me, so that I can get data with 3 months gap between them but not last 3 months.
Thanks,
Sai
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
84 | |
66 | |
62 | |
62 |
User | Count |
---|---|
199 | |
120 | |
110 | |
79 | |
69 |