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

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

Reply
CraigBlackman
Helper III
Helper III

Calculate quantity built based on 2 x 12 hour shift pattern

Hi,

 

I have a table that provides me with a quantity build and the date/time that item was built. We are moving to a 2 x 12 hour shift pattern runny 7am to 7pm and then 7pm to 7am.

 

I want to break down the quantity built into these shifts so we can see productiuvity. How would I go about doing so?

 

Thanks

 

Craig

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@CraigBlackman Use below DAX to create calculated column to group into shiftA and shiftB and then filter.

 

Column = IF(AND(HOUR('tableName'[datetimeColumn]) >= 7,HOUR('tableName'[datetimeColumn]) <= 19), "shiftA", "shiftB")

View solution in original post

3 REPLIES 3
ankitpatira
Community Champion
Community Champion

@CraigBlackman Use below DAX to create calculated column to group into shiftA and shiftB and then filter.

 

Column = IF(AND(HOUR('tableName'[datetimeColumn]) >= 7,HOUR('tableName'[datetimeColumn]) <= 19), "shiftA", "shiftB")

@ankitpatira, works a charm, was over looking a simple solution.

PavelR
Solution Specialist
Solution Specialist

Hi @CraigBlackman. I would just derive custom column from this datetime column and mark rows which have datetime 7am to 7pm as "ShiftA" and the rest as "ShiftB". Then you can filter by this column, or create measure where you have filter on just ShiftA´s data.

 

Regards.

Pavel

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors