Forum Discussion

jalaomar's avatar
jalaomar
Helper IV
2 years ago
Solved

Filter within a measure

Hi,

 

Trying to add filter in measure I am using 

Current Measure: 

Scheduled vs Actual Effort = DIVIDE(SUM(PVEffort[ActualEffort]); SUM(TimePlanned[PlannedEffort]))
 
And the add filter conext within the measure itself based on the following criteria
Organisation = is not blank
WorkType = "Installation" & "Absence"
 
anyway to add this filter context within the measure?
 
BR
J
  • Scheduled vs Actual Effort with Filters = //try this one
    CALCULATE(
    DIVIDE(
    SUM(PVEffort[ActualEffort]),
    SUM(TimePlanned[PlannedEffort])
    ),
    NOT(ISBLANK('TableName'[Organisation])),
    'TableName'[WorkType] = "Installation" || 'TableName'[WorkType] = "Absence"
    )
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi jalaomar ,

    mh2587 Good answer! And you can also try this:

    Measure = 
    CALCULATE(
        DIVIDE(
            SUM(PVEffort[ActualEffort]),
            SUM(TimePlanned[PlannedEffort])
        ),
        'PVEffort'[Organisation] <> BLANK(),
        'PVEffort'[WorkType] IN { "Installation", "Absence" }
    )

    I've tested both DAXs and they're both correct.

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to both of the answers to help the other members find it more quickly.

2 Replies

  • Scheduled vs Actual Effort with Filters = //try this one
    CALCULATE(
    DIVIDE(
    SUM(PVEffort[ActualEffort]),
    SUM(TimePlanned[PlannedEffort])
    ),
    NOT(ISBLANK('TableName'[Organisation])),
    'TableName'[WorkType] = "Installation" || 'TableName'[WorkType] = "Absence"
    )
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jalaomar ,

    mh2587 Good answer! And you can also try this:

    Measure = 
    CALCULATE(
        DIVIDE(
            SUM(PVEffort[ActualEffort]),
            SUM(TimePlanned[PlannedEffort])
        ),
        'PVEffort'[Organisation] <> BLANK(),
        'PVEffort'[WorkType] IN { "Installation", "Absence" }
    )

    I've tested both DAXs and they're both correct.

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to both of the answers to help the other members find it more quickly.