Forum Discussion
Fixed Time Buttons for Table
- 4 years ago
Hi Anonymous,
May be you can try use the slicer like the following :
If this ok, create a measure as a dynamic tag and let it in filters pane.
Measure = var _2hours = NOW()-TIME(2,0,0) var _12hours = NOW()-TIME(12,0,0) var _24hours = NOW()-TIME(23,59,59) var _weekhours = NOW()-TIME(23,59,59)*7 var _month = NOW()-TIME(23,59,59)*30 return SWITCH(TRUE(), SELECTEDVALUE(Button[button])="2 hours",_2hours, SELECTEDVALUE(Button[button])="12 hours",_12hours, SELECTEDVALUE(Button[button])="24 hours",_24hours, SELECTEDVALUE(Button[button])="week",_weekhours, SELECTEDVALUE(Button[button])="month",_month,TIME(0,0,0)) Measure 2 = IF(SELECTEDVALUE('Table'[DateTime])>=[Measure],1,BLANK())If you want use button, bookmarks and slicer are used in combination. Bookmarks are linked to the specified slicer.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous,
May be you can try use the slicer like the following :
If this ok, create a measure as a dynamic tag and let it in filters pane.
Measure =
var _2hours = NOW()-TIME(2,0,0)
var _12hours = NOW()-TIME(12,0,0)
var _24hours = NOW()-TIME(23,59,59)
var _weekhours = NOW()-TIME(23,59,59)*7
var _month = NOW()-TIME(23,59,59)*30
return
SWITCH(TRUE(),
SELECTEDVALUE(Button[button])="2 hours",_2hours,
SELECTEDVALUE(Button[button])="12 hours",_12hours,
SELECTEDVALUE(Button[button])="24 hours",_24hours,
SELECTEDVALUE(Button[button])="week",_weekhours,
SELECTEDVALUE(Button[button])="month",_month,TIME(0,0,0))
Measure 2 = IF(SELECTEDVALUE('Table'[DateTime])>=[Measure],1,BLANK())
If you want use button, bookmarks and slicer are used in combination. Bookmarks are linked to the specified slicer.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I think this is better and faster way.
"If you want use button, bookmarks and slicer are used in combination. Bookmarks are linked to the specified slicer." So I created buttons, bookmarks and slicer, but some reason it does not update my table with last 2 hours or 24 hours when I clicked on buttons. Please tell me v-chenwuz-msft where I missed the point.
- v-chenwuz-msft4 years agoCommunity Support
Hi Anonymous ,
More instructions with steps
1 Create 4 buttons, one slicer and 4 bookmarks.
on 2 hours bookmark, select '2 hours' in slicer and hide the slicer. update '2 hours' bookmark.
other bookmarks are same as it. Hide the slier after selecting.
2 Set the action of buttons.
You can refer this video in the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
That's it! Thank you so much v-chenwuz-msft !This is the exactly what I needed it! I understood everything on video was helpful, I think I miss one point it is on the pict. When you dragged If > start measure. Please could you explain how also created this Button sections and If>, etc measures. Please.. Looking forward to complete it when you send me another video. Thank you!
- v-chenwuz-msft4 years agoCommunity Support
Hi Anonymous ,
Button table, I created this table via enter data.
'IF>start' is the 'measure 2'.
When you write selectedvalue in measure( StartTime ), the value after the equal sign should be the value in your button table.
Now = Now()
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.