Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Columns via Slicer Selection for Dates

Hi,

 

I have seen several other posts covering things that seem similar but ultimately are different.

 

I have an interval filter which isn't tied to anything:

- Day

- Week

- Month

- Year

 

I have a date range which is a dax table which has a start and end date based on my model. I'm putting these in a secondary slicer.

- 06/01/2014

- many days between

- 10/4/2018

^This table also has columns for weeknumber, monthnumber, and year.

 

My goal is to have the user select an interval, and then have corresponding options change the secondary slicer to the relevant options. Ex: The user selects Month in the primary filter and then the second filters options become 1-12. IF the user selects "Day" then the secondary filter becomes all the days, etc.

 

Is there a way to do this? Thanks!

  • Anonymous's avatar
    Anonymous
    7 years ago

    Thank you yulgu. I actually found a way to somewhat do this. Essentially, creating a date table using

     

     

    Union(
    SelectColumns("Selections", Column1forDays, "Order", 1, "Category", "Days"),
    SelectColumns("Selections", Column2forWeeks, "Order", 2, "Category", "Weeks"),
    etc for months, years

     

     

    Then making a primary filter on Category (Days, Weeks, Months, Years from the above).

    And a secondary filter on Selections from the above.

     

    The only remaining issue is solving for slicer cross-filtering as once something in the Selection slicer category is selected, it limits the category selections accordingly. I found I can solve this by making the primary filter a table and setting it to ignore the selection slicer via edit interactions. However, that solution isn't very elegant.

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous,

     

    No. As of now, such a requirement is not supported by Power BI.

     

    Best regards,

    Yuliana Gu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you yulgu. I actually found a way to somewhat do this. Essentially, creating a date table using

       

       

      Union(
      SelectColumns("Selections", Column1forDays, "Order", 1, "Category", "Days"),
      SelectColumns("Selections", Column2forWeeks, "Order", 2, "Category", "Weeks"),
      etc for months, years

       

       

      Then making a primary filter on Category (Days, Weeks, Months, Years from the above).

      And a secondary filter on Selections from the above.

       

      The only remaining issue is solving for slicer cross-filtering as once something in the Selection slicer category is selected, it limits the category selections accordingly. I found I can solve this by making the primary filter a table and setting it to ignore the selection slicer via edit interactions. However, that solution isn't very elegant.