Forum Discussion

Randcharles's avatar
Randcharles
Helper I
2 years ago
Solved

How to - Cascading customized date filter on Power BI

Hi all,

I would like to reproduce the same customized visual date filter as below on my report  :


So, according to the "Periodicity" that you select from the Periodicity dropdwon filter, your second segment "Period" should allow you to choose a different date range. For example, when you select "Mensuel" ( Monthly) from "Periodicité", the "Periode" segment should allow you to select only Monthly Column ( preformatted as " YYYY-MMMM").  The same for "Hebdo" (Weekly) from Periodicity, you should be able to select Weekly period ( preformatted as YYYY-W-WeekNumber) from the second segment.
I have tried to use "Field Parameter" to build the first segment "Periodicity" which may allow user to choose the " Weekly, Monthly, Daily" like this : 

 

Périodicité = {
("Quotidien", NAMEOF('Dim_Date'[Quotidien]), 0),
("Hebdo", NAMEOF('Dim_Date'[Hebdo]), 1),
("Mensuel", NAMEOF('Dim_Date'[Mensuel]), 2)
}

 

So I have the table created from this field parameter on my data model.

And in my Dim_Date table, I created 3 custom columns : Daily ( dd-mm-yyyy), Weekly (YYYY-W-WeekNumber) and Monthly (YYYY-MMMM). 

 

For the moment, there is no relationship between my Dim_Date and My Periodicite table. 

I tested within my report, it doesn't work. I can't make dependance on my 2 tables for cascading the filter from "Periodicity" to my column inside Dim_Table : Hebdo(week), Daily(Quotidien), Monthly (Mensuel) according to selected periodicity type.

 

Does anyone know how to implement those filter option on the Power BI report ? 
What is the missing step on my process if it's the right one.
Thanks in advance.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Randcharles ,
    Based on your description, you want to create parameters to display different columns as slicers. If measure is used based on the selected parameters, the slicer does not support measure. If you force the parameter to use other fields, the slicer will not display the column in its entirety.
    So, there are two ways you can do this:
    First, you can use the unpviot three columns to make the column names in the same column, so that you can build a slicer with the two columns after unpviot.

     

     


    In the second way, you can continue to use the parameters, and in the second you can replace the slicer with a table and put the parameters into the table visualization. After that, you can click on the data on the table to filter
    it

     

    Best regards,
    Albert He

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Hi Anonymous ,

    Thanks a lot for your help and advice. 
    It works for me. I have used the first option by using parameter with unpivot columns.
    Great idea! 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Randcharles ,
    Based on your description, you want to create parameters to display different columns as slicers. If measure is used based on the selected parameters, the slicer does not support measure. If you force the parameter to use other fields, the slicer will not display the column in its entirety.
    So, there are two ways you can do this:
    First, you can use the unpviot three columns to make the column names in the same column, so that you can build a slicer with the two columns after unpviot.

     

     


    In the second way, you can continue to use the parameters, and in the second you can replace the slicer with a table and put the parameters into the table visualization. After that, you can click on the data on the table to filter
    it

     

    Best regards,
    Albert He

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Hi Anonymous ,

    Thanks a lot for your help and advice. 
    It works for me. I have used the first option by using parameter with unpivot columns.
    Great idea!