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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Nigel92
Regular Visitor

Divide count of a column trough a value of another column

Hello, 

 

I have 2 tables with dates, they are M to 1 linked. The first table has a bunch of serial number that are produced on that day. 

Nigel92_2-1720785214243.png

 


In the second table I have the shift schedule (1/2 shifts).

Nigel92_1-1720785031098.png

 

Out of this I want to find the production count per shift. Is there a simple way to do a count over the serial numbers and divide it between the number that is in the second table [Amount] in the corresponding date? 

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Nigel92 -create a calculated column in the production table to divide the production count by the shift amount for the corresponding date

calculated columns:

 

ProductionCountPerShift =
VAR CurrentDate = 'ProductionTable'[Date]
VAR ShiftAmount = RELATED('ShiftSchedule'[Amount])
RETURN DIVIDE(CALCULATE(COUNT('ProductionTable'[SerialNumber]), 'ProductionTable'[Date] = CurrentDate), ShiftAmount)

 

create measure for production count

TotalProductionCount = COUNT('ProductionTable'[SerialNumber])

 

another calculation to shift 

ProductionCountPerShift =
VAR ShiftAmount = SELECTEDVALUE('ShiftSchedule'[Amount])
RETURN DIVIDE([TotalProductionCount], ShiftAmount)

 

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @Nigel92 -create a calculated column in the production table to divide the production count by the shift amount for the corresponding date

calculated columns:

 

ProductionCountPerShift =
VAR CurrentDate = 'ProductionTable'[Date]
VAR ShiftAmount = RELATED('ShiftSchedule'[Amount])
RETURN DIVIDE(CALCULATE(COUNT('ProductionTable'[SerialNumber]), 'ProductionTable'[Date] = CurrentDate), ShiftAmount)

 

create measure for production count

TotalProductionCount = COUNT('ProductionTable'[SerialNumber])

 

another calculation to shift 

ProductionCountPerShift =
VAR ShiftAmount = SELECTEDVALUE('ShiftSchedule'[Amount])
RETURN DIVIDE([TotalProductionCount], ShiftAmount)

 

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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