Hi
I need to create 3 buttons: Today, Yesterday and 2 days before.
I tried using bookmarks but only succeeded in making Today button by using my date slicer relative date set to today - save to bookmarks and make a new button linked to that bookmark - problem I can't get back to original state anymore. Also this way doesn't work for yesterday or 2 days before because I can't set my date slicer to show only yesterday etc. ( should be dynamic not manually set to yesterday, since tomorrow today is yesterday )
I can make new columns with required dates but can't make a button out of columns.
I might add the report is in direct query.
Solved! Go to Solution.
Hi , @Lyhis
You can take a try this method that does not use bookmarks and buttons.
The steps are as follows:
1.Create a custom as below:
Power query:
=if [Date] = Date.From(DateTime.LocalNow()) then "Today" else if [Date] =Date.From(Date.AddDays(DateTime.LocalNow(),-1)) then "Yesterday" else if [Date] =Date.From(Date.AddDays(DateTime.LocalNow(),-2)) then "2 Days Before" else [Date]
2.Then enter a table as below
3. Build relationships between tables,then you can drag the fields into the treemap to filter the data to achieve a similar effect
Best Regards,
Community Support Team _ Eason
I prefer @v-easonf-msft solution but it requires import mode and daily dataset refresh - keep that in mind.
Hi , @Lyhis
You can take a try this method that does not use bookmarks and buttons.
The steps are as follows:
1.Create a custom as below:
Power query:
=if [Date] = Date.From(DateTime.LocalNow()) then "Today" else if [Date] =Date.From(Date.AddDays(DateTime.LocalNow(),-1)) then "Yesterday" else if [Date] =Date.From(Date.AddDays(DateTime.LocalNow(),-2)) then "2 Days Before" else [Date]
2.Then enter a table as below
3. Build relationships between tables,then you can drag the fields into the treemap to filter the data to achieve a similar effect
Best Regards,
Community Support Team _ Eason
"I need to create 3 buttons: Today, Yesterday and 2 days before." Are you sure? Have you considered doing a horizontal slicer instead? Looks just like buttons.
"I might add the report is in direct query" That is no longer a problem. You can have in-row calculated columns in direct query sourced tables.
I already have a date slicer but for some reason bosses want those buttons too, I don't know why either because slicer works just fine. I might aswell talk to them that its pointless.
Check out new user group experience and if you are a leader please create your group
100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.
User | Count |
---|---|
404 | |
197 | |
85 | |
80 | |
62 |
User | Count |
---|---|
474 | |
218 | |
135 | |
91 | |
83 |