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
jaymetbar
Frequent Visitor

Need help modifying a production number based on other data points

New to Power BI and I am trying to generate reports based on our production cells. I am ultimately trying to piece together something more complicated than this, but I am stuck at this current point of the problem.

 

Overview: We produce lbs. of product out of different vessels. We have the vessels that we harvested noted in a day. We need to pull a piece of production out of each vessel to sample the quality. We take all those samples and assign their production lbs. to an arbitrary Vessel #1 for the day. 

 

Please see the data below:

Production DateVessel NumberProduction
1/1/19991111654
1/1/19991210976
1/1/19991312673
1/1/19991410769
1/1/19991510628
1/1/19991612563
1/1/19991710290
1/1/19991810031
1/1/19991912518
1/1/19992012246
1/1/199912645
1/2/19992112310
1/2/19992211833
1/2/19992310139
1/2/19992411800
1/2/19992511702
1/2/19992610470
1/2/19992712182
1/2/19992810665
1/2/19992910880
1/2/19993010037
1/2/199912758

 

What I'm trying to accomplish:


I need to create a new column that runs along side the "Production" column which calculates the true vessel production based on the sample weight being added back to the vessel production.

 

The formula should be something like:

True Vessel Production = (Vessel Production + (Vessel #1 Production Weight/Count of Vessels Harvested in a day  <> 1)

 

For example, the True Production for Vessel #11 on 1/1/1999 should equal to:

 

TP = (11654+(2645/10)) = 11919

 

I hope this request makes sense. Please let me know if you have any questions and I'd be happy to clarify.

 

I'm hoping to use this number to calculate a vessel efficiency since I can calculate what the theoretical production should be. I may need help averaging a value between the dates that a certain vessel was harvested, but that's a question for another time.

 

I appreciate the help!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Perhaps:

 

Column = 
    VAR __Vessel1Value = MAXX(FILTER('Table',[Vessel Number] = 1 && [Production Date] = EARLIER('Table'[Production Date])),[Production])
    VAR __Count = COUNTROWS(FILTER('Table',[Vessel Number] <> 1 && [Production Date] = EARLIER('Table'[Production Date])))
RETURN
    [Production] - __Vessel1Value / __Count

@ 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

3 REPLIES 3
Greg_Deckler
Super User
Super User

Here is the PBIX I used if it helps (attached below)

 


@ 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
Super User
Super User

Perhaps:

 

Column = 
    VAR __Vessel1Value = MAXX(FILTER('Table',[Vessel Number] = 1 && [Production Date] = EARLIER('Table'[Production Date])),[Production])
    VAR __Count = COUNTROWS(FILTER('Table',[Vessel Number] <> 1 && [Production Date] = EARLIER('Table'[Production Date])))
RETURN
    [Production] - __Vessel1Value / __Count

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

amazing. Thanks so much!

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.