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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jyeager
Helper I
Helper I

Help Needed! Divide Column in One Table by Column in Another Table

Hi there! I'm hoping all the smart people out there can help me with this. 

 

I need a measure that will divide budgeted_hours by the estimated_units in another table. The caviat is that I have a quantity basis I need referenced in order to do find the right estimated_units. So for example:

 

Job #1 has budgeted labor hours for the following activities:

  • "Set-up" activity: 50 hours
  • "Casting" activity: 100 hours
  • "Patching" activity: 10 hours

Job #1 also has budgeted quantities that we are producing and each quantity type corresponding to the activity above:

  • "Set-ups": 1 (relates to Set-up activity)
  • "Beams": 5 (relates to Casting and Patching activities)

 

I would like to have a measure that would tell me for Job #1 I have 50 hours per set-up (50 hours divided by 1 set-up) and that I have 20 hours per beam for casting (100 hours divided by 5 beams) and 2 hours per beam for patching (10 hours divded by 5 beams).

 

I have attached the two tables and how the are linked:

tbl_structure.PNG

 

it should be something like psi-labor_budgets[budgeted_hours] / psi-qty_budgets[orig_est_units] ... but then filtered or realted to the cost_basis.... I know all the smart folks out there can help me with this one! thanks in advance!!

 

Jim

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@jyeager - You will need to use RELATEDTABLE or you could use LOOKUPVALUE so something like:

 

Measure = 
  DIVIDE(
    SUM('psi-labor_budgets'[budgeted_hours]),
    SUMX(RELATEDTABLE('psi-qty_budgets'),[orig_est_units]),
    0
  )

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@jyeager - You will need to use RELATEDTABLE or you could use LOOKUPVALUE so something like:

 

Measure = 
  DIVIDE(
    SUM('psi-labor_budgets'[budgeted_hours]),
    SUMX(RELATEDTABLE('psi-qty_budgets'),[orig_est_units]),
    0
  )

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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