Forum Discussion

EZimmet's avatar
EZimmet
Resolver I
1 year ago
Solved

Assistance with syntax to include multiple values from same column

Assistance with syntax to include multiple values from same column   VAR DC_Data = COUNTROWS ( FILTER ( FILTER ( FILTER ( FILTER (    'Power Pull',    'Power Pull'[DC] = "AZ" ),     NOT CONTAIN...
  • rajendraongole1's avatar
    1 year ago

    Hi EZimmet  - Instead, it's best to use a single FILTER with IN for multiple values, which makes it cleaner and more efficient.

    VAR DC_Data =
    COUNTROWS (
    FILTER (
    'Power Pull',
    'Power Pull'[DC] = "AZ" &&
    NOT CONTAINSSTRING ( 'Power Pull'[Outbound], "Note*" ) &&
    'Power Pull'[EQType] IN { "Smart PDU", "PDU", "MainFrame", "Sensor", "Storage", "Storage Frame" } &&
    'Power Pull'[DisplayLabel] = "Live"
    )
    )

    RETURN
    SWITCH (
    TRUE(),
    MAX ( 'Metrics- Site'[Expected] ) = "DC", DC_Data + 0
    )

     

    hope this works. please check