Forum Discussion
Problem with Selection in custom visualization
Why not creating a calendar table in hours and slicer the hours then?
Thanks for your suggestion.
How can I create calendar table in hours as i have created calendar table for date purpose but how can i put time in it and bifurcate it to hours. It will be very helpful if you can show the DAX for it.
- Eric_Zhang9 years agoMicrosoft Employee
You can try
calendar table in hours = SELECTCOLUMNS ( ADDCOLUMNS ( CROSSJOIN ( CALENDAR ( "2016-01-01", "2017-12-31" ), SELECTCOLUMNS ( ADDCOLUMNS ( CALENDAR ( "2016-01-01", "2016-01-24" ), "DAY", DAY ( [Date] ) ), "DAY", [DAY] ) ), "dateTime", [Date] + IF ( [DAY] = 24, 0, [DAY] ) / 24 ), "Date", [Date], "dateTime", [dateTime] )- as79 years agoAdvocate II
thanks.
But, my requirement is to have a time slicer that can slice my data from one time to other time . and power BI dosen't have such time slicer.
- Eric_Zhang9 years agoMicrosoft Employee
Do you want to slice a time window like '02:00' to '15:00' for all days? If so, there's some workaround by creating proper lookup tables and measures.
Check a similar thread Specify custom date periods with predefined date periods. The difference is, you have to create start time and end time and filter the data with them, rather than start date and end date in that link.