Forum Discussion

itsmeanuj's avatar
itsmeanuj
Icon for Helper IV rankHelper IV
5 years ago
Solved

Filter to select only Friday

I have 2 columns in my data - Week & Sales. Week column contains dates with only Friday. However, when I put a week at the top as a slicer (filter), it gives an option to the user to select all the dates instead of just Friday. I want that the user can select only Friday and the other dates/days get greyed out (or the user cannot select them). Is it possible?  

 

I have placed the PBI with sample data here - https://drive.google.com/file/d/1YVeWPCMAud2LaEr3TJqFY6XaRZ1YsvT_/view?usp=sharing

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi itsmeanuj ,

     

    You will need to use list format.

    Create a new table as slicer.

    week = DISTINCT(Sheet1[Week])

     Then create a measure.

    Measure = 
    var min_week = MIN(week[Week])
    var max_week = MAX(week[Week])
    var selected_week = SELECTEDVALUE(Sheet1[Week])
    return
    IF(selected_week>=min_week&&selected_week<=max_week,SELECTEDVALUE(Sheet1[Sales]),BLANK())

    Result would be shown as below.

     

    Best Regards,

    Jay

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion

    Hi, itsmeanuj , you might want to uncheck this option in the option menu to retain Fridays in the slicer.

     

    In the mean time, make the slicer in the format List.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi itsmeanuj ,

     

    You will need to use list format.

    Create a new table as slicer.

    week = DISTINCT(Sheet1[Week])

     Then create a measure.

    Measure = 
    var min_week = MIN(week[Week])
    var max_week = MAX(week[Week])
    var selected_week = SELECTEDVALUE(Sheet1[Week])
    return
    IF(selected_week>=min_week&&selected_week<=max_week,SELECTEDVALUE(Sheet1[Sales]),BLANK())

    Result would be shown as below.

     

    Best Regards,

    Jay