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
Susan_Colyn
Helper I
Helper I

Formula for calculating Mechanical Efficiency for a specific machine type

Hi,

 

I need help with a Dax formula.

 

I have to calculate the Mechanical Efficiency and I have the formula for this but my data includes different machine types and I would like to add a type of filter to the formula, as I only want the Mechanical Efficiency for a certain type.

 

Her is my data - Location of the machine, Type (Filling machine or Downstream Equipment), Production Time, Equipment Stop Time

Example 1.jpg

 

The formula I have currently for Mechanical Efficiency is

Example 2.jpg

 

Is there a type of filter I add to this formula to only get the FM result.

 

Regards,

Susan

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

A Measure would be (names may be different at your side)

MMEFM = SUMX(FILTER(MME, MME[objType] = "FM"), DIVIDE(SUM(MME[PT fm/de]), SUM(MME[PT fm/de]) + SUM(MME[EST fm/de])))

There are other ways to do it. Switch on 'Show items with no data' in a table visualisation to see the other object types

 

Am i right that it only makes sense in a row context?  If so, the calculated column would be

ColumnMMEFM = IF (MME[objType] = "FM", DIVIDE(MME[PT fm/de], MME[PT fm/de] + MME[EST fm/de]),0)

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

A Measure would be (names may be different at your side)

MMEFM = SUMX(FILTER(MME, MME[objType] = "FM"), DIVIDE(SUM(MME[PT fm/de]), SUM(MME[PT fm/de]) + SUM(MME[EST fm/de])))

There are other ways to do it. Switch on 'Show items with no data' in a table visualisation to see the other object types

 

Am i right that it only makes sense in a row context?  If so, the calculated column would be

ColumnMMEFM = IF (MME[objType] = "FM", DIVIDE(MME[PT fm/de], MME[PT fm/de] + MME[EST fm/de]),0)

Hi,

 

Thank you for assisting but I need more help, please.  I thought the formula worked but I still had 'FM" selected in the Page filter.  I just removed it and the result is incorrect.  It doesn't filter "FM".

 

I tried the IF formula and it only allows Measures after IF.  I received an error when using the Column name.  

 

Is there another formula I can use?

Thank you, I used the SUMX formula and it works perfectly

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.