Forum Discussion
Date slicer
- 24 days ago
Hi pradipir ,
Thank you for reaching out to fabric community.
Below steps will give the date in the format DD-MMM-YYYY.
- Add a Date column and set its Data type to Date.
- With the Date column selected, open Column tools -> Format -> Custom.
- Apply the following format: dd-MMM-yyyy
- Insert a Slicer visual and add the Date column to it.
- Open Format -> Slicer settings -> Options → Style -> Choose Date picker.
- Specify the required date range using the From Date and To Date fields.
Thanks!!
Hi pradipir ,
Building on ShivekMaharaj explanation: since the Between slicer's input boxes follow the viewer's locale, a common workaround is to keep the native Between slicer for selecting dates and show the chosen range in your format right next to it.
1. Create this measure:
Selected Date Range =
VAR _from = MIN ( 'Date'[Date] )
VAR _to = MAX ( 'Date'[Date] )
RETURN
FORMAT ( _from, "dd-mmm-yyyy", "en-US" ) & " to " &
FORMAT ( _to, "dd-mmm-yyyy", "en-US" )2. Add a Card visual with this measure and place it directly above the slicer. The "en-US" locale argument keeps the month abbreviation as "Jan" for every viewer.
3. Optionally, turn off the slicer header and use the card as its label. Users then pick dates with the Between slicer and read the range as 01-Jan-2020 to 31-Dec-2020.
The selection still works as a true date filter, and users always see the dates in DD-MMM-YYYY.