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.
I would like the ability to set the start and end ranges of a date slicer to select from a formula or query, I can't see any way to do this currently.
I do not believe that I can use the Page Level filters because I want the Slicer to suggest a range only and for the user to be able to change it if they want.
for example: The user, when accessing the report, will see the last complete month selected for them. TODAY() = 3/3/2017 Slicer range should default to 1st Feb 2017 to 28th Feb 2017 but if the user wants to view a different range then they can change it themselves, to any other date range.
Solved! Go to Solution.
Hi @wickenss,
>>I would like the ability to set the start and end ranges of a date slicer to select from a formula or query, I can't see any way to do this currently.
You can simple use allselected and lastdate/firstdata to get the selected range, then write a measure to calculate on it.
Calculate on Dateslicer= var SelectMinDate=FIRSTDATE(ALLSELECTED(Table[Date])) var SelectMaxDate=LASTDATE(ALLSELECTED(Table[Date])) return SUMX(FILTER(ALL(Table),[Date]>=SelectMinDate&&[Date]<=SelectMaxDate),[Value])
BTW, current date slicer not support setting default value.
Regards,
Xiaoxin Sheng
Hi @wickenss,
>>I would like the ability to set the start and end ranges of a date slicer to select from a formula or query, I can't see any way to do this currently.
You can simple use allselected and lastdate/firstdata to get the selected range, then write a measure to calculate on it.
Calculate on Dateslicer= var SelectMinDate=FIRSTDATE(ALLSELECTED(Table[Date])) var SelectMaxDate=LASTDATE(ALLSELECTED(Table[Date])) return SUMX(FILTER(ALL(Table),[Date]>=SelectMinDate&&[Date]<=SelectMaxDate),[Value])
BTW, current date slicer not support setting default value.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |