Forum Discussion
Custom Date Slicers
Hi All,
I need the urgent help in custom date slicer.
User want to have a radio button slicer it should have MTD and Custom values.
when user selected the MTD option, the calendar date picker should allow user to select from the 1st of the current month to till today's date( all future dates in the current month calendar picker should be greyed out).
when user select Custom option from the radio button slicer, it should show normal date range slicer to select history and future dates.
Can anyone help in this and share the sample pbxi file to understand the logic.
Thanks,
Sri
As mentioned in my last response, you can achieve it using bookmarks.
In the PBIX which I shared, boomarks are created and you can refer itConnect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
12 Replies
- tharunkumarRTKSuper User
1. Create an MTD flag column in your date table using M language or DAX
2. Create two bookmarks
MTD: with a drop down slicer and a visual level MTD flag = TRUE filterCustom bookmark with a Between type date slicer
As far as I know with native power bi slicers its not possible to change the type of a slicer from Between to dropdown or vice versa based on the selection of a value in another slicer. With bookmarks you can achieve it
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
- KoritalaPost Patron
Hi Tharun,
can you plz share pbxi file which you have created?
Thanks,
Sri
- tharunkumarRTKSuper User
Please find the pbix attached
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
- KoritalaPost Patron
Hi Tharun,
In your pbxi file, when MTD selected, it is showing all the dates for the current month instead of showing first date to today's date. can you plz review once and let me know?
Regards,
Sri
- tharunkumarRTKSuper User
Just update the MTD flag logic
Table.AddColumn( #"Changed Type", "MTD Flag", each [Date] >= Date.StartOfMonth(Date.From(DateTime.LocalNow())) and [Date] <= Date.From(DateTime.LocalNow()), type logical )Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
- v-hashadapuCommunity Support
Hi Koritala , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.
- KoritalaPost Patron
- v-hashadapuCommunity Support
Hi Koritala , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.
- v-hashadapuCommunity Support
Hi Koritala , Thank you for reaching out to the Microsoft Community Forum.
I reproduced the scenario on my end using a short sample data based on tharunkumarRTK 's pbix and it worked successfully. To help you better understand the implementation, I’ve attached the .pbix file for your reference. Please take a look at it and let me know your observations.
Thank you tharunkumarRTK for your valuable response.
- KoritalaPost Patron
Hi hashadapu,
date logic working as expected. But one morething is that at a time I should show one date slicer only based on selection of the tabs. How can we achive that? can you share updated pbxi plz?
Thanks,
Sri
- tharunkumarRTKSuper User
As mentioned in my last response, you can achieve it using bookmarks.
In the PBIX which I shared, boomarks are created and you can refer itConnect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!