Forum Discussion

hugo_barbara's avatar
hugo_barbara
Helper I
10 months ago
Solved

Dynamic Measure that modifies status based on filters

Hello, I need to create a dynamic measure that updates the status of an item based on what is selected in a slicer. I’m working with a dataset of Issues and Epics from an agile model, and I want to...
  • v-echaithra's avatar
    v-echaithra
    10 months ago

    Hi hugo_barbara ,

    Please try this measure by using CALCULATE to enforce that the status measure respects the Sprint context. Below is an updated version of your measure that should handle the context appropriately:

    Epic Status by Sprint =
    VAR PointsAwarded =
    CALCULATE(
    SUM(d_EpicosIssues[STORYS_POINTS_REALIZADOS]), d_IssueStatus[ISSUE_STATUS_NAME] IN {"Accepted", "In Production", "Pending Production"})

    VAR PlannedPoints =
    CALCULATE(
    SUM(d_EpicosIssues[STORYS_POINTS_REALIZADOS]), d_IssueStatus[ISSUE_STATUS_NAME] <> "Canceled")

    VAR Completeness = DIVIDE(PointsAwarded, PlannedPoints, 0)

    RETURN
    SWITCH(TRUE(), ISBLANK(PointsAwarded) || PointsAwarded = 0, "Not Started",
    PointsAwarded < PlannedPoints && TODAY() < MAX(d_calendarioPISprints[SPRINT_END_DATE]), "At Risk",
    PointsAwarded < PlannedPoints && TODAY() >= MAX(d_calendarioPISprints[SPRINT_END_DATE]), "Overdue",
    PointsAwarded >= PlannedPoints && TODAY() < MAX(d_calendarioPISprints[SPRINT_END_DATE]) && Completeness < 1, "Rescheduled",
    PointsAwarded >= PlannedPoints && TODAY() >= MAX(d_calendarioPISprints[SPRINT_END_DATE]) && Completeness < 1, "On Time",
    Completeness >= 1, "Completed",
    "Unclassified")

    Hope this helps.
    Thank you.