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

Apply Measure with Criteria

Hello,

 

I have 4 specific measures that I would like to combine into one column by their respective asset.

 

I have 4 assets that are measured by efficiency differently, hence why I created 4 specific measures. The issue I have is I would like to see these on one chart by asset. Per below, I have a separate chart for efficiency since I can't find a way to tie it into my first chart.

 

Example Measures:

Melt 1 = CALCULATE((SUM(AM_PRODUCTION_RESULT[TtL Lbs]) / sum(AM_PRODUCTION_RESULT[Hrs])) / 600)
Melt2  = CALCULATE((SUM(AM_PRODUCTION_RESULT[TtL Lbs]) / sum(AM_PRODUCTION_RESULT[Hrs])) / 450)
 
chart1.JPGchart2.JPG
 
 
2 ACCEPTED SOLUTIONS
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, you may try this measure.

Efficiency = 
var _asset = MAX(AM_PRODUCTION_RESULT[ASSET])

return
IF(
    _asset = "Meltblown 01 60in Accurate",
    SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/600,
    IF(
        _asset = "Meltblown 02 45in Accurate",
        SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/450,
        IF(
            _asset = "Meltblown 04 40in Accurate",
            SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/400,
            IF(
                _asset = "Meltblown_05 60in Accurate",
                SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/600,
                IF(
                    _asset = "Meltblown_06 27in Accurate",
                    SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/270
                )
            )
        )
    )
)

 

Result:

c1.png

 

Best Regards

Allan

 

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

Hi, @Anonymous 

 

Yes, you can manage to achieve your requirement. You may create a measure as follows.

DisplayColor = 
var _asset = MAX(AM_PRODUCTION_RESULT[ASSET])
return
SWITCH(
    TRUE(),
    CONTAINSSTRINGEXACT(_asset,"60"),1,
    CONTAINSSTRINGEXACT(_asset,"45"),2,
    CONTAINSSTRINGEXACT(_asset,"40"),3,
    CONTAINSSTRINGEXACT(_asset,"27"),4,
    0
)

 

Then you can go to 'Format' area, click 'Conditional formatting' .

x2.png

 

Then you can click 'Advanced controls' and configure as follows.

x3.png

 

Result:

x4.png

 

Best Regards

Allan

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, you may try this measure.

Efficiency = 
var _asset = MAX(AM_PRODUCTION_RESULT[ASSET])

return
IF(
    _asset = "Meltblown 01 60in Accurate",
    SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/600,
    IF(
        _asset = "Meltblown 02 45in Accurate",
        SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/450,
        IF(
            _asset = "Meltblown 04 40in Accurate",
            SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/400,
            IF(
                _asset = "Meltblown_05 60in Accurate",
                SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/600,
                IF(
                    _asset = "Meltblown_06 27in Accurate",
                    SUM(AM_PRODUCTION_RESULT[TtL Lbs])/SUM(AM_PRODUCTION_RESULT[Hrs])/270
                )
            )
        )
    )
)

 

Result:

c1.png

 

Best Regards

Allan

 

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

Anonymous
Not applicable

This is great!! Thank you! 

 

Is it possible to apply conditonal formatting in the same way? Based on those criteria by asset, each set has it's own condtional formatting for background color. 

snip1.JPGsnip2.JPG

 

 

 

Hi, @Anonymous 

 

Yes, you can manage to achieve your requirement. You may create a measure as follows.

DisplayColor = 
var _asset = MAX(AM_PRODUCTION_RESULT[ASSET])
return
SWITCH(
    TRUE(),
    CONTAINSSTRINGEXACT(_asset,"60"),1,
    CONTAINSSTRINGEXACT(_asset,"45"),2,
    CONTAINSSTRINGEXACT(_asset,"40"),3,
    CONTAINSSTRINGEXACT(_asset,"27"),4,
    0
)

 

Then you can go to 'Format' area, click 'Conditional formatting' .

x2.png

 

Then you can click 'Advanced controls' and configure as follows.

x3.png

 

Result:

x4.png

 

Best Regards

Allan

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.