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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
SSBkrish
Regular Visitor

Auto change once shift changes

Hi Experties,

I wouldlike to set auto change option once 1st shift completed it should start showing 2nd shift data.
Ex : 1st shift is 6AM to 12 PM 
       2nd shift is 12 PM to 6PM.

 

When the 1st shift ends @ 11:59 AM and 2nd shift start from 12PM. 1st shift data should show when time is (6AM to11:59AM) when time is 12PM it should automatically should show the 2nd shift data in the visuals (Dashboard)
Any help here would be appreciated.
Thanks in advance

1 ACCEPTED SOLUTION
Selva-Salimi
Super User
Super User

hi @SSBkrish 

 

did you have a column in your data which includes values "1st shift / 2nd shift" ?? if so, then you can write a measure as follows:

 

Measure=  var shift_definition =if(HOUR(NOW()) >=6 && HOUR(NOW()) <12 , "1st shift" , if(HOUR(NOW()) >=12 && HOUR(NOW()) <18 , "2nd shift",0))
 return
 if (selectedvalue(your_table [shift]) = shift_definition , 1,0)
 
and then add this to your visual filter pane and set it to 1 as follows:
 
SelvaSalimi_0-1733233904266.png

 

 

if it doesn't work please provide more details of your table data.

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Selva-Salimi
Super User
Super User

hi @SSBkrish 

 

did you have a column in your data which includes values "1st shift / 2nd shift" ?? if so, then you can write a measure as follows:

 

Measure=  var shift_definition =if(HOUR(NOW()) >=6 && HOUR(NOW()) <12 , "1st shift" , if(HOUR(NOW()) >=12 && HOUR(NOW()) <18 , "2nd shift",0))
 return
 if (selectedvalue(your_table [shift]) = shift_definition , 1,0)
 
and then add this to your visual filter pane and set it to 1 as follows:
 
SelvaSalimi_0-1733233904266.png

 

 

if it doesn't work please provide more details of your table data.

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

 

I am getting beloow errorauto2.PNG

Anonymous
Not applicable

Hi @SSBkrish ,

Agree with Selva-Salimi's, you did not give your measure a name. After testing, Selva-Salimi's method itself should be fine.
After giving your measure a name, can you solve your problem? If solved, please accept Selva-Salimi's reply as solution to help the other members find it more quickly.

Best Regards,
Dino Tao

did you define a name for your measure before defining "var"? I mean...

 measure := var shift_definition......

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.