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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
afaque03
Helper I
Helper I

To get shift from current date

Hi Need Help,

 

I am stucked in a situation where I have to get data like I want to extract current hour and then I have to compare that current hour from the set of hour shift Provided. In this case the shift 1 consist of hours like {"5","6","7","8","9","10","11","12"}, shift 2 {"13","14","15","16","17","18","19","20"} and shift 3 is {"00","01","02","03","04","21","22","23"}.

 

Suppose I extract hour from current time and it is 03 then this comes under shift 3 timing i.e, {"00","01","02","03","04","21","22","23"} then shift 3 will be considered as current shift and the rest of the shift will be considered as previous shift.

when suppose the hour changes to 5 then it lies in shift {"5","6","7","8","9","10","11","12"} i.e, it becomes current shift and the rest becomes the previous shift.

 

So i want this current shift and previous shift as filter so when I select current shift and if the current hour is 03 than the data fr shift 3 becommes the current shift data the rest becomes previous shift data. So the chart should show the current shift data for shift 03 and if in this case I select previous shift data than chart should show the data for rest of shift.

 

1 REPLY 1
v-yuta-msft
Community Support
Community Support

HI afaque03,

 

Create two columns, one column [value] contains values in 3 shifts, another column [shift key] contains shift numbers corresponding to values in [value] column. Then you can create a slicer based on [shift key] column and create a chart based on [value] column.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors