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
Anonymous
Not applicable

DAX Product of Measure results

Hi all,

 

I need a measure that calculates the efficiency of a production plant. The plant produces products of different technologies, and the full production process is divided into steps called 'specs'.

 

The efficiency needs to be calculated for each technology and spec but the calculation is different.

 

The efficiency for each spec is calculated by the following formula: (SUM(MoveInQty)-SUM(Reject TotalQty)) / SUM(MoveInQty)

This works perfectly in a measure.

 

Now the difficult part is that the effiency of a technology is calculated by doing a product of each spec efficiency.

For example if I put a filter on technology 'ABC' and the efficiency of spec 1 = 50% and spec 1 = 25% (both of only products of technology ABC!) then the technology efficiency of ABC would be 12,5%.

 

Ideally I would do a product of the measure results like: Tech efficiency = PRODUCT([Spec efficiency])

 

Is this possible to do in DAX? Or maybe I need to change the data model? See the model below.

 

 Relationship modelRelationship model

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

I'd try something like this (replace the red syntax with the relevant reference

PRODUCTX(ADDCOLUMNS(SUMMARIZE(Table,Table[Spec]),"Eff",[Spec efficiency]),[Eff])

the code calculates efficency per spec and then returns product of the calculation



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi s041507

 

For example if I put a filter on technology 'ABC' and the efficiency of spec 1 = 50% and spec 1 = 25% (both of only products of technology ABC!) then the technology efficiency of ABC would be 12,5%.

 

<--- Could you share some related sample data of this example?


Regards,

Jimmy Tao

Stachu
Community Champion
Community Champion

I'd try something like this (replace the red syntax with the relevant reference

PRODUCTX(ADDCOLUMNS(SUMMARIZE(Table,Table[Spec]),"Eff",[Spec efficiency]),[Eff])

the code calculates efficency per spec and then returns product of the calculation



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Worked like a charm, thanks Stachu!

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.