Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Larry_Wang
Helper I
Helper I

Customized Slicer

Hi everyone,

 

I want to create a customized or smart slicer that contains two parts of the date data. See table below for details of the data. If I create simple slicer using column "Date", it will include all date data. See below picture.

What I want is in the slicer I can separate it into two parts, one is before 12/20/2021 and the other one is after (include) 12/20/2021.

 

Larry_Wang_0-1653532146525.png

 

 

ProductRatingDate
ID11 ++5/12/2018
ID22 +6/24/2018
ID32 +11/18/2018
ID43 o3/31/2019
ID54 -4/11/2019
ID65 --7/17/2019
ID74 -2/9/2020
ID34 -3/10/2020
ID41 ++10/21/2020
ID53 o11/9/2020
ID65 --11/25/2021
ID15 ++12/20/2021
ID24 +1/4/2022
ID31 --2/19/2022
ID42 -5/30/2022
ID74 +7/13/2022

 

So what I want to see the slicer is like below:

 

Larry_Wang_1-1653532626031.png

 

Thanks,

 

Larry

1 ACCEPTED SOLUTION

Hi @Larry_Wang , Larry, 
Thanks for the screenshot. 
I would suggest to Power query to create the custom grouping based on your requirement. 
Using the 'Add a Column' transformation in Power Query -> add a Conditional Column to your query. 

dhruvinushah_0-1653668418227.png
Refer screenshot above to see the conditions for Old dates and new dates above. You can modify as and how you need. Any new dates that are added will follow suit using this condition. 


If this helps, please remember to mark my answer as a solution to your question and give thumbs up!
Thanks.

 









View solution in original post

4 REPLIES 4
dhruvinushah
Responsive Resident
Responsive Resident

Hi Larry @Larry_Wang , 
One idea that popped up in my head for your requirement was for you to create a button functionality for you or your end user to filter the report page before/after your date: 12/20/2021. 
You can do so by creating a power BI group on your date field. Group dates into two categories:
1. old dates (from beginning till before 12/20/2021) 
2. new dates ( from 12/20/2021 {including} and forward to your last date}

You can then bring this group onto a horizontal slicer {which will appear as buttons} and add the newly created group field into it. 
The user can simply select Old Dates for those dates or the New Dates. 

Let me know if you need any help further along this idea. 


hope this helps. Thanks









Hi @dhruvinushah ,

 

Thank you for the suggetion on this issue. I did a test but I can only create group by list and if I add some new data entries in the source file, I can see some ungrouped values. See below picture for details. It is better to create a group or new column that converts all date earlier than 12/20/2021 with value "old" and the rest of the date change to "new". 

 

Larry_Wang_0-1653564534608.png

 

Thanks,

 

Larry

Hi @Larry_Wang , Larry, 
Thanks for the screenshot. 
I would suggest to Power query to create the custom grouping based on your requirement. 
Using the 'Add a Column' transformation in Power Query -> add a Conditional Column to your query. 

dhruvinushah_0-1653668418227.png
Refer screenshot above to see the conditions for Old dates and new dates above. You can modify as and how you need. Any new dates that are added will follow suit using this condition. 


If this helps, please remember to mark my answer as a solution to your question and give thumbs up!
Thanks.

 









Hi @dhruvinushah ,

 

This conditional column works fine for me and I use a hierachy slicer to do the filter. See picture below for details.

 

Larry_Wang_0-1653879717361.png

 

But if I create two seperate slicers like the ones shown in picture below, and I select New in slicer Custom_Date and there is no change in the second slicer. I checked the interaction settings and no issue.

 

Larry_Wang_1-1653879909290.png

 

Thanks,

 

Larry

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.