Forum Discussion

pradipir's avatar
pradipir
New Member
4 days ago

Date slicer

Hi, I need some help with Power BI.

I want to use a Between Date Slicer and display the dates in this format:

DD-MMM-YYYY
Example: 01-Jan-2020

I don’t want to use the default dropdown/date format. I specifically want the Between slicer with two date inputs (From Date and To Date), but I need the displayed dates to appear as 01-Jan-2020 instead of the default format.

Could you please guide me on how to achieve this? If the standard Power BI slicer does not support this format, is there any custom visual or alternative solution that can provide the same Between Date functionality with the DD-MMM-YYYY format?

Thanks!

3 Replies

  • v-sathmakuri's avatar
    v-sathmakuri
    Icon for Community Support rankCommunity Support

    Hi pradipir​ ,

    Could you review the suggestion provided above and let us know if you have any additional questions, we are happy to address. 

    Thanks!!

  • ShivekMaharaj's avatar
    ShivekMaharaj
    Icon for Memorable Member rankMemorable Member

    Hi pradipir​,

    There is one important limitation with the native Between date slicer that is worth mentioning.

    Microsoft's current date range slicer documentation states that dates in the Between slicer are displayed using the Short Date format determined by the user's browser or operating-system locale.

    It also specifically notes that this happens regardless of the date format configured on the underlying column or semantic model.

    So setting the Date column format to dd-mmm-yyyy can affect how that field appears in other visuals, but it will not force the classic Between slicer's two input boxes to display dates such as 01-Jan-2020.

    I would therefore distinguish two requirements.

    If you specifically need the classic Between slicer with the From and To input boxes, the native visual currently does not provide a separate format setting that lets you force those boxes to DD-MMM-YYYY.

    If you can use the newer Date picker slicer experience instead, Microsoft documents that the displayed date range follows the column's format string. You can read about the current slicer options in the Slicer visual documentation.

    For the model-level date format itself, Power BI supports custom date formats such as dd-mmm-yyyy, as described in the custom format string documentation.

    I would keep the field as a true Date type rather than converting it to text just to obtain the display format, because converting it to text would remove the normal date-range behaviour of the native Between slicer.

    So for the exact requirement:

    • Between slicer + two date inputs + DD-MMM-YYYY display -> not currently configurable in the native Between slicer
    • Date picker with custom model date format -> worth using if its interaction style meets your requirement
    • If the exact Between-style UI is mandatory, a custom visual or custom date-range implementation would be needed.

     

    AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.

     

     

  • v-sathmakuri's avatar
    v-sathmakuri
    Icon for Community Support rankCommunity Support

    Hi pradipir​ ,

    Thank you for reaching out to fabric community.

    Below steps will give the date in the format DD-MMM-YYYY.

    1. Add a Date column and set its Data type to Date.
    2. With the Date column selected, open Column tools -> Format -> Custom.
    3. Apply the following format: dd-MMM-yyyy
    4. Insert a Slicer visual and add the Date column to it.
    5. Open Format -> Slicer settings -> Options → Style -> Choose Date picker.
    6. Specify the required date range using the From Date and To Date fields.

    Thanks!!