Forum Discussion
D-1 functionality on PBIX with single date picker feature
- Anonymous1 year ago
Hi julsr ,
As long as you don't bookmark a Preselected Slicer, its default selected date is automatically updated every day. If you need the data from other pages to be filtered synchronously, you just need to sync the slicer as I did before.
Also, the buttons in Power BI Desktop do not support filtering data directly. In addition to Preselected Slicer, you can also consider creating calculated tables and measures. But your report has many pages, so it's easier to create measures. Here is the method about measure for your reference:
check = VAR table1= ALL('dummy-sales-data'[Fecha]) VAR table2= ALLSELECTED('dummy-sales-data'[Fecha]) VAR test= IF ( COUNTROWS ( EXCEPT ( table1, table2 ) ) = 0 && COUNTROWS ( EXCEPT ( table2, table1 ) ) = 0, TRUE, FALSE ) RETURN IF(test,IF(MAX('dummy-sales-data'[Fecha])=DATE(2024,1,19),1,2),IF(MAX('dummy-sales-data'[Fecha]) in table2,1,2))When I click the "Clear all slicers" button, only set Date rows will be displayed in the table.
Other things you need to do:
1. Set filters for other visuals.
2. Manually adjust the column width or change the column background color to hide the "check".
———————————————————————————————————————————————————
Please choose the method that suits you according to your needs. If my answer solves this issue, please accept it as a solution, which will show it to more people who need help.
Best regards,
Mengmeng Li
Great explanation, thanks! So, just to confirm, it's not possible to have a button that when clicked filters the data to D-1 without being a bookmark, right? (because as I will be using it in the future, the D-1 will be different for all coming days).
The solution you propose is to add to the measures that I have now the D-1 condition, but this will affect when D-1 is not active, or I should have 2 measures for the same calculation, D-1, and others.
Do you think it could work to have the "Check" Measure you created as a slicer? So when the user selects 1 in the check slicer, all the data in the report will be filtered to meet this criteria?
Hi julsr ,
Yes, as far as I know, the currently built-in buttons don't have the ability to filter data directly.
The first method is the "D-1", where you don't need to set bookmarks, and the "Reset" and "Clear" buttons that come with the Preselected Slicer will basically meet your needs. The second method is to create a measure for the filter, but you'll need to add it to each visual you want to filter on and set the filter.
The above are two different methods, the "D-1" method is faster than creating a measure, but the Preselected Slicer does not support the selection of date ranges like the built-in slicer, and the second method allows you to use the built-in date slicer, but obviously it requires you to do a lot of repetitive work, such as setting filters and hiding the "check" column.
Best regards,
Mengmeng Li
- julsr1 year ago
Continued Contributor
Ok, understood. Thanks for your help! One last question I'm facing now: do you know how I can implement it with the Single Date functionality that I showed in the Power BI file?
It's a single date picker option that uses the "After" instead of the "In Between" option, and then to apply it to all the visualizations, I'm using the filter as shown in the image below. The problem is that when I use the "Clear All Slicers" option, it goes back to the first date of my dataset instead of considering the Check column you sent me. Here is the link to the updated PBIX file.
Thank you!