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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mpataki32
Helper III
Helper III

Date slicer with an additional radio button slicer

I have a date slicer:

mpataki32_0-1701365107716.png

The end-users asked me to create a feature which will help them to click less, altough they like that they have the full period to see the data, but they want to see the current month data when they open the report, for that I have two questions in my mind: 

 

- Is there a way to setup the existing filter to always show the current month, but if the user want it then they can expand it to full period? 

 

- If the previous feature is not doable with the basic PBI visualizations, then I thinked about to have another slicer next to the original slicer and the new slicer is going to have two option: 

          - Current month --> Only shows the current month's data

          - Full period --> Shows the full period's data including the current month's data as well. 

 

For the second feature I started to create an custom column in my date table, but the problem is that altough I have an aux table with the option I don't know, how to setup the new slicer in a way to do that kind behaviour or should I use two column in my date table? One for the current month (identifying all the dates which belongs to the actual month) and another column which will identify the full period's dates? 

 

1 ACCEPTED SOLUTION
CoreyP
Solution Sage
Solution Sage

A couple options:

1) Rather than a Between slider for date, you could use a Relative slider. ( e.g. Last 1 month, 2 months, etc. ) And then when you publish, have it already set to Last 1 Month so that will be the default view.

2) Your second option would also work. You just need to add a column to your date table:

CurrentMonth = IF( AND( MONTH( 'Date'[Date] ) = MONTH( TODAY() ) , YEAR( 'Date'[Date] ) = YEAR( TODAY() ) ) , "Show Current Month Only" , BLANK() )

Then add this column as a button slicer next to your date slider. You'll notice you'll have two buttons, one of which is blank. We want to hide this, so we basically have a single button toggle. In the filter pane of the visual, uncheck the blank, and have "Show Current Month Only" checked. 

When a user selects that, it will filter the content on your report page for only the current month. When the user deselects that, all data will be shown.

View solution in original post

3 REPLIES 3
CoreyP
Solution Sage
Solution Sage

A couple options:

1) Rather than a Between slider for date, you could use a Relative slider. ( e.g. Last 1 month, 2 months, etc. ) And then when you publish, have it already set to Last 1 Month so that will be the default view.

2) Your second option would also work. You just need to add a column to your date table:

CurrentMonth = IF( AND( MONTH( 'Date'[Date] ) = MONTH( TODAY() ) , YEAR( 'Date'[Date] ) = YEAR( TODAY() ) ) , "Show Current Month Only" , BLANK() )

Then add this column as a button slicer next to your date slider. You'll notice you'll have two buttons, one of which is blank. We want to hide this, so we basically have a single button toggle. In the filter pane of the visual, uncheck the blank, and have "Show Current Month Only" checked. 

When a user selects that, it will filter the content on your report page for only the current month. When the user deselects that, all data will be shown.

Thank you so much! I made a similar DAX, but instead of Blank() I just started to populate zeros and I wanted to categorize each element into a category (I wanted to cordinate them with an aux table), your solution is better. 

Obviously make the formatting according to your design language, but something like this should be easy for user experience.

CoreyP_0-1701374898169.pngCoreyP_1-1701374929992.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.