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.
Is it possible to change the value of a date range filter using a measure?
I have this period filter that is in page1
it only affects visuals like table, cards, etc.
But I don't know if it's possible to change the value of a date range itself.
This date filter is in page2. Hopefully there's a workaround.
Solved! Go to Solution.
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi, @dabeans518
You can try using slicer synchronization:
1.Firstly, modify the slicer on the page:
2.Secondly, create the following measure:
MEASURE =
VAR cc1 =
MAX ( 'Table'[Column1] )
RETURN
SWITCH (
TRUE (),
cc1 = "YTD", IF ( YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () ), 1, 0 ),
cc1 = "MTD",
IF (
YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
&& MONTH ( MAX ( 'Table 2'[Date] ) ) = MONTH ( TODAY () ),
1,
0
),
FALSE ()
)
3.Apply the measure to the slicer:
4.Here is the final result, which I hope meets your requirements:
It is recommended to change the slicer style to “tile,” as the current “between” style may cause issues.
For detailed information, please refer to:
Enable the Sync Slicers feature in Power BI visuals - Power BI | Microsoft Learn
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi, @dabeans518
You can try using slicer synchronization:
1.Firstly, modify the slicer on the page:
2.Secondly, create the following measure:
MEASURE =
VAR cc1 =
MAX ( 'Table'[Column1] )
RETURN
SWITCH (
TRUE (),
cc1 = "YTD", IF ( YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () ), 1, 0 ),
cc1 = "MTD",
IF (
YEAR ( MAX ( 'Table 2'[Date] ) ) = YEAR ( TODAY () )
&& MONTH ( MAX ( 'Table 2'[Date] ) ) = MONTH ( TODAY () ),
1,
0
),
FALSE ()
)
3.Apply the measure to the slicer:
4.Here is the final result, which I hope meets your requirements:
It is recommended to change the slicer style to “tile,” as the current “between” style may cause issues.
For detailed information, please refer to:
Enable the Sync Slicers feature in Power BI visuals - Power BI | Microsoft Learn
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
That would be a question for your data model. While you cannot programmatically set slicer boundaries the field that feeds the slicer can be impacted by external filters.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |