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
Reuben
Helper III
Helper III

Relate production date with nominal speed

Hi all,

 

I came up with the following problem:

I have two tables:

- The data table shows daily production by production line.

- The lookup table contains the nominal speed of each production line. It is a fixed value that only changes when the production line is changed or an improvement is  made.

In my example production line1 was working at 5.000 unit/hour from 01/07/2014 until 09/04/2017, at 5.500 from 10/04/2017 to 17/02/2019, and at 6000 from 18/02/2019 until now.

What I want is a DAX measure, that relates for each produccion date, the corresponding nominal speed.

 

Thank you very much for yor help.

Reubben

 

 

Lookup Table = Nominal Speed   Data Table = Production  
          
Production LineStarting dateSpeed unit/hour   Production DateLineUnitsSpeed/hour
Line101/07/20045.000   01/07/2015Line120.0005.000
Line110/04/20175.500   30/01/2018Line125.0005.500
Line118/02/20196.000   01/01/2019Line135.0006.000
Line201/07/200410.000       
Line301/07/20049.000       
Line310/08/201610.000       
2 ACCEPTED SOLUTIONS
v-xicai
Community Support
Community Support

 Hi @Reuben 

 

Firstly, create column Speed/hour to meet your demand.

 

Speed/hour = maxx(TOPN(1,FILTER('Nominal Speed','Nominal Speed'[Production Line]=Production[Line]&&'Nominal Speed'[Starting date]<=Production[Production Date]),'Nominal Speed'[Starting date],DESC),'Nominal Speed'[Speed unit/hour])

 

Then, choose table visual to display the result.

 

6.png

 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EfB-bp4PE1xEjXtUso...

 

Best Regards,

Amy

 

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

Thank you very much @v-xicai  for your help. and for attaching the test file. much appreciated!!

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

 Hi @Reuben 

 

Firstly, create column Speed/hour to meet your demand.

 

Speed/hour = maxx(TOPN(1,FILTER('Nominal Speed','Nominal Speed'[Production Line]=Production[Line]&&'Nominal Speed'[Starting date]<=Production[Production Date]),'Nominal Speed'[Starting date],DESC),'Nominal Speed'[Speed unit/hour])

 

Then, choose table visual to display the result.

 

6.png

 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EfB-bp4PE1xEjXtUso...

 

Best Regards,

Amy

 

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

Thank you very much @v-xicai  for your help. and for attaching the test file. much appreciated!!

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.