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
Krzysztof_Hyla
Helper II
Helper II

Matching quantity with hours to calculate earned hours

I'd like to multiply quantity of units produced or forecasted for a particular month by the appropriate standard hours - the result measure will be called 'Earned Hours'.

 

Normally a sumx and related formula should work, but the thing is that we have to apply current standard hours to future months in the formula.

 

Table 1: Production_Forecast

ScenarioPeriodModelQuantity Produced or Planned
Actual201901A5
Actual201901B6
Actual201911A3
Actual201911B4
Actual201912A7
Actual201912B8
Forecast202001A5
Forecast202001B4

 

Table 2: Standard Hours

PeriodModelDepartmentStandard Hours
201901ABackshop5
201901AFinal Assembly2
201901BBackshop6
201901BFinal Assembly1
 
201912ABackshop7
201912AFinal Assembly2.5
201912BBackshop8
201912BFinal Assembly3

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

So what is the result you are looking for?

 


@ 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...

The measure should add results from two calculations:

1) For months tagged as "Actual" - multiply quantity produced by the related hours for particular month (Excel sumproduct formula): quantity from Jan 2019 times standard hours from Jan 2019, quantity from Feb 2019 times standard hours from Feb 2019

2) For months tagged as "Forecast" - multiply quantities from all months by the last available standard hours (Dec 2019 standard hours in the example shown)

 

Here is the model:

Model.jpg

 

and PBIX file: Earned Hours.pbix 

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.

Top Solution Authors