0

I am using the following DAX in the measure below:

UPS %No Maint Bypass =
VAR TotalMaintBypass =
    COUNTROWS (
        FILTER ( ALL ( 'UPS (2)' ), 'UPS (2)'[UPS Maintenance Bypass] = "TRUE" )
    )
        + COUNTROWS (
            FILTER ( ALL ( 'UPS (2)' ), 'UPS (2)'[UPS Maintenance Bypass] = "FALSE" )
        )
        + COUNTROWS (
            FILTER (
                ALL ( 'UPS (2)' ),
                'UPS (2)'[Redundant UPS Maintenance Bypass] = "TRUE"
            )
        )
        + COUNTROWS (
            FILTER (
                ALL ( 'UPS (2)' ),
                'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"
            )
        )
VAR NoMaintBypass =
    COUNTROWS (
        FILTER ( ALL ( 'UPS (2)' ), 'UPS (2)'[UPS Maintenance Bypass] = "FALSE" )
    )
        + COUNTROWS (
            FILTER (
                ALL ( 'UPS (2)' ),
                'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"
            )
        )
RETURN
    DIVIDE ( NoMaintBypass, TotalMaintBypass, 0 ) * 100 + 0

how can I add the if statement ('UPS (2)', IF('UPS (2)'[Redundant UPS] = "TRUE") when UPS (2)'[Redundant UPS Maintenance Bypass] is used. In 3 places.

Any assistance is appreciated.

1
  • could you pls elaborate more on this? or pls provide some sample data and expected output. Commented May 14 at 9:40

1 Answer 1

0
UPS %No Maint Bypass = VAR TotalMaintBypass = COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[UPS Maintenance Bypass] = "TRUE")) + COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[UPS Maintenance Bypass] = "FALSE")) + COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[Redundant UPS] = "TRUE" && 'UPS (2)'[Redundant UPS Maintenance Bypass] = "TRUE")) + COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[Redundant UPS] = "TRUE" && 'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"))
VAR NoMaintBypass    = COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[UPS Maintenance Bypass] = "FALSE")) + COUNTROWS(FILTER(ALL('UPS (2)'), 'UPS (2)'[Redundant UPS] = "TRUE" && 'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"))
RETURN
DIVIDE(NoMaintBypass, TotalMaintBypass, 0) * 100 +0

same as above:
UPS %No Maint Bypass = 
VAR TotalMaintBypass = 
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[UPS Maintenance Bypass] = "TRUE"
        )
    ) +
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[UPS Maintenance Bypass] = "FALSE"
        )
    ) +
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[Redundant UPS] = "TRUE" &&
            'UPS (2)'[Redundant UPS Maintenance Bypass] = "TRUE"
        )
    ) +
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[Redundant UPS] = "TRUE" &&
            'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"
        )
    )

VAR NoMaintBypass = 
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[UPS Maintenance Bypass] = "FALSE"
        )
    ) +
    COUNTROWS(
        FILTER(
            ALL('UPS (2)'), 
            'UPS (2)'[Redundant UPS] = "TRUE" &&
            'UPS (2)'[Redundant UPS Maintenance Bypass] = "FALSE"
        )
    )

RETURN 
    DIVIDE(NoMaintBypass, TotalMaintBypass, 0) * 100 +0
Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.