Forum Discussion

aziffarhan's avatar
aziffarhan
Regular Visitor
1 year ago
Solved

Visualization (Buttons and Slicers)

Hi everyone!
I'm currently working on an interactive Power BI dashboard and I’ve run into a challenge. I want to include slicers and buttons that allow users to filter by YearQuarter, and Month.
My goal is to make the experience smooth and conflict-free — for example, avoiding situations where selecting Q1 and August (which belongs to Q3) results in no data.
I’ve tried using bookmarks to toggle between different slicer views, but I’m finding it a bit confusing to manage, especially since there are already quite a few bookmarks involved in the report.

Has anyone implemented something similar? What’s the best way to structure this so users don’t get confused or end up with conflicting filters?
Any tips on DAX logic, slicer design, or UX best practices would be greatly appreciated!

 

 

  • danextian's avatar
    danextian
    1 year ago

    You could just create another conditional formatting measure but this time should be applied to the callout value of the buttons.

    Slicer Highlight Color = 
    IF (
        SELECTEDVALUE ( MonthsOnly[Month Short] ) IN VALUES ( Dates[Month Short] ),
        "white" --#ffffff for hexadecimal
    )

13 Replies

  • This approach is simple to set up, requires no complex DAX, and is very intuitive for the end-user.

     

    1. Build a Proper Calendar Table
    The foundation of any good report is a solid calendar table. Make sure you have a table in your model with at least the following columns. This table should be marked as a date table and have a relationship to your data.

    • Date (a continuous list of dates)
    • Year
    • Quarter (e.g., "Q1", "Q2")
    • Month Name
    • Quarter Number (for sorting)
    • Month Number (for sorting)

    2. Create a Hierarchy
    A formal hierarchy will make the slicer "aware" of the relationship between the fields.

    1. Go to the Model view in Power BI Desktop.
    2. In the Data pane, find your Calendar table.
    3. Drag the Quarter column and drop it directly onto the Year column.
    4. Drag the Month Name column and drop it onto the Quarter column you just added to the hierarchy.
    5. Rename the hierarchy to something logical, like "Date Hierarchy".


    3. Configure the Slicer Visual

    1. Add a Slicer visual to your report canvas.
    2. Drag the entire Date Hierarchy you just created from your Calendar table into the slicer's Field well.
    3. To get the button-like appearance from your screenshot, go to the Format your visual pane:
      Select Slicer settings > Style and choose Tile.
      You can adjust the layout and appearance further under the Values formatting options.


    This single slicer will now provide a guided, drill-down experience:

    • Initial View: The slicer will show only the Years.
    • Drill to Quarters: When a user clicks on a year (e.g., "2025"), the slicer will automatically replace the years with the quarters for 2025 (Q1, Q2, Q3, Q4).
    • Drill to Months: If they then click on a quarter (e.g., "Q2"), the slicer will update again to show only the months within that quarter (Apr, May, Jun).

    Users can navigate back up the hierarchy using the "Drill up" arrow in the slicer's header. This design makes it impossible to create a conflicting selection and eliminates the need for any complex bookmarks or DAX.

     

    If this explanation and solution resolve your issue, please like and accept the solution.

    • aziffarhan's avatar
      aziffarhan
      Regular Visitor

      Hi Sandip_Palit, thank you for your help!

      Unfortunately, I don’t think a drill-down slicer is what I’m looking for at the moment. I’d like the slicer to display all Years, Quarters, and Months directly, so users can click on any of them without needing to drill down step by step.

      I’d really appreciate your help with this setup.

      Thank you!

  • Hi aziffarhan Are the columns coming from the same table? If so, selecting a value in any of the slicers should crossfilter the others unless visual interactions between them have been disabled. If the columns are from different tables, it can cause issues with filtering behavior. As a best practice, use a dedicated date or calendar table that includes all relevant date components (such as date, year, month, quarter, day, week number, etc.).

     

    • aziffarhan's avatar
      aziffarhan
      Regular Visitor

      Hi danextian, thank you so much for your help! I really appreciate it.

      There are a few things I still need help with.

      Firstly, all the columns I’m using are from the same table. I’ve already created a Date Hierarchy consisting of Year, Quarter, Month, and Day.

      What I’d like to achieve is the following behavior:

      • When a user selects a Quarter (e.g., Q2), the respective Months within that quarter — April, May, and June — should also be automatically selected or highlighted.
      • Similarly, when a user selects a Month (e.g., June), the corresponding Quarter (in this case, Q2) should also be selected or highlighted, even if only one month from that quarter is selected.

      Is there a way to implement this kind of synchronized selection behavior in Power BI? I’d really appreciate any guidance or suggestions you can offer.

      Thanks again!

      • danextian's avatar
        danextian
        Super User

        Have you checked if visual interactions are enabled for those slicers? With or without hierarchy, as long as the interaction is enabled, you will get the same behaviour as in the image in my initital response. Also, please check if indeed the columns are from the same table - it could be a column with the same name but from another table.

  • v-lgarikapat's avatar
    v-lgarikapat
    Community Support

    Hi aziffarhan ,

    Thank you for reaching out to the Microsoft fabric community forum.

    danextian , Sandip_Palit ,

    Thanks for your prompt response

    aziffarhan ,

    We’d like to confirm whether your issue has been successfully resolved. If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.

     

    Best Regards,

    Lakshmi

    • v-lgarikapat's avatar
      v-lgarikapat
      Community Support

      Hi aziffarhan ,

       

      We’d like to confirm whether your issue has been successfully resolved. If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.

       

      Best Regards,

      Lakshmi

      • v-lgarikapat's avatar
        v-lgarikapat
        Community Support

        Hi aziffarhan ,

         

        We’d like to confirm whether your issue has been successfully resolved. If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.

         

        Best Regards,

        Lakshmi