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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

Operate constants in a table with time-dependent measures. Power Pivot.

Hello community.

I am working on estimating production losses due to downtime at the various stages of planning and operation. In the plant we have 11 machines that produce different products at different standard hourly rates, whose values we have determined experimentally with time studies, these measures are constant over time. On the other hand, in my data model I have been able to determine for each day the different times lost in the different stages of interest.

In an excel sheet I then have a table with two columns, the name of the machine and its respective production standard and on the other hand I have developed with DAX functions different measures of lost time, which depend on time. The issue is that when I try to multiply these two values to get the kilos of lost material with the following structure:

lost kilos = sum(Prod_Corregida[Shift without Programming])*sum(Prod_Ideal[EPH])

Prod_Corregida is a table with the different lost times sorted by machine and date, while Prod_Ideal is the two-column table mentioned previously with machines and the time production standard (EPH).

Relationships between tables only allow me to filter by machines and not by dates, where it throws me erroneous values. My question is then: How can I make Power Pivot recognize the EPH measure valid for any period of time on their respective machine when I use it in operations with other data that does depend on time besides the machines?.

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin 

Just add a filter like Prod_Corregida[Date] = MAX(Prod_Ideal[Date]) in your measure. I build a sample.

Prod_Corregida:

1.png

Prod_Ideal:

2.png

Build a relationship between two tables by Machine.

If we use this measure we will get wrong result, due to the filter of relationship is only Machine without Date.

lost kilos = sum(Prod_Corregida[Shift without Programming])*sum(Prod_Ideal[EPH])

 Try this measure:

Measure = 
VAR _Shift = SUM(Prod_Corregida[Shift without Programming])
VAR _EPH = CALCULATE(sum(Prod_Ideal[EPH]),FILTER(Prod_Ideal,Prod_Ideal[Date] = MAX(Prod_Corregida[Date])))
RETURN
_Shift * _EPH
Measure 2 = SUMX(Prod_Corregida,[Measure])

Result is as below.

3.png

If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Syndicate_Admin 

Just add a filter like Prod_Corregida[Date] = MAX(Prod_Ideal[Date]) in your measure. I build a sample.

Prod_Corregida:

1.png

Prod_Ideal:

2.png

Build a relationship between two tables by Machine.

If we use this measure we will get wrong result, due to the filter of relationship is only Machine without Date.

lost kilos = sum(Prod_Corregida[Shift without Programming])*sum(Prod_Ideal[EPH])

 Try this measure:

Measure = 
VAR _Shift = SUM(Prod_Corregida[Shift without Programming])
VAR _EPH = CALCULATE(sum(Prod_Ideal[EPH]),FILTER(Prod_Ideal,Prod_Ideal[Date] = MAX(Prod_Corregida[Date])))
RETURN
_Shift * _EPH
Measure 2 = SUMX(Prod_Corregida,[Measure])

Result is as below.

3.png

If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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