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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

BEGGING FOR HELP

Hi, 

 

I asked a few times before and I want to try one more time to get for help. I am kind of new with Power BI. I need to create buttons to change time period on the page for tables. Here is what it must be look like buttons.

timebuttons.PNG

Here is my data.  Requirement is when the user clicks on button (12 hours or 24 hours etc) other tables on the page should be updated with this period. Please even sharing video ir anything will help. Please.. Looking forward to hearing. Thank you

 

data.PNG

2 ACCEPTED SOLUTIONS
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;
If you use button ,you could use bookmark ,such as:

1.create 6 buttons.

vyalanwumsft_0-1642042244270.png

2.create three measure.

2hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=2&&_diff>=0,1)
2hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=2&&_diff>=0,1)
24hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=24&&_diff>=0,1)

3.create 6 bookmarks.

2hours:

vyalanwumsft_1-1642042752436.png

12 hours:

vyalanwumsft_2-1642042770926.png

24 hours:

vyalanwumsft_3-1642042786503.png

week:

vyalanwumsft_4-1642042945973.png

custom:add other page

vyalanwumsft_5-1642042966857.png

4:add action to button.

vyalanwumsft_6-1642043004643.png

The final output is shown below:

vyalanwumsft_7-1642043092690.png

 

Or you could use slicer may be more convenient.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi, @Anonymous ;

You can set filter, Filter on this visual,not filter on page for each table.

https://docs.microsoft.com/en-us/power-bi/create-reports/power-bi-report-add-filter

 

vyalanwumsft_0-1642468810447.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;
If you use button ,you could use bookmark ,such as:

1.create 6 buttons.

vyalanwumsft_0-1642042244270.png

2.create three measure.

2hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=2&&_diff>=0,1)
2hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=2&&_diff>=0,1)
24hours = 
var _diff=DATEDIFF(MAX('Table'[DateTime]),NOW(),HOUR)
return IF(_diff<=24&&_diff>=0,1)

3.create 6 bookmarks.

2hours:

vyalanwumsft_1-1642042752436.png

12 hours:

vyalanwumsft_2-1642042770926.png

24 hours:

vyalanwumsft_3-1642042786503.png

week:

vyalanwumsft_4-1642042945973.png

custom:add other page

vyalanwumsft_5-1642042966857.png

4:add action to button.

vyalanwumsft_6-1642043004643.png

The final output is shown below:

vyalanwumsft_7-1642043092690.png

 

Or you could use slicer may be more convenient.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-yalanwu-msft  , thank you so much your helpful reply! I made a progress with your solution but I wonder if we have 2-3 or 4 tables on this report page and we want to update them this time period limitation so how e are going apply it ? Looking forward to hearing your help.

Anonymous
Not applicable

Hi @v-yalanwu-msft , thank you so much your helpful reply! I made a progress with your solution but I wonder if we have 2-3 or 4 tables on this report page and we want to update them this time period limitation so how e are going apply it ? Looking forward to hearing your help.

Hi, @Anonymous ;

You can set filter, Filter on this visual,not filter on page for each table.

https://docs.microsoft.com/en-us/power-bi/create-reports/power-bi-report-add-filter

 

vyalanwumsft_0-1642468810447.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you so muxh, it worked well done! @v-yalanwu-msft 

JR-DCPS
Advocate II
Advocate II

Is there a reason you're not creating a filter for the time field? It can handle what you want to do without creating a bunch of bookmarks and extra measures.

Anonymous
Not applicable

It is the requirement that has to be buttons or specific time period filters like on the pict. If you have any idea please feel free to share how you can. @JR-DCPS 

amitchandak
Super User
Super User

@Anonymous , Can you give this data in table /text format. Also what is expected when a filter is selected.

 

If this is based on today and now you need to add measure in visual (or all the measures should follow the filter like one added below) , or use these measures as filter in the visual level filter 

 

last 12 hours = Countrows(filter(Table, Table[EndtimeET] <= Now() && Table[EndtimeET] > Now() -time(12,0,0)))

 

last 24 hours =

Countrows(filter(Table, Table[EndtimeET] <= Now() && Table[EndtimeET] > Now() -1))

 

This month =

Countrows(filter(Table, Table[EndtimeET] <= eomonth(today(),0)= eomonth(Table[EndtimeET],0) ))

 

You need to use bookmark button of you need measure slicer for this

 

bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

 

measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak

 

I tried to share data with pbix but the file type is not supported, I do not know why. Is there anyway I can share it with you ? 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.