Forum Discussion

Ste4en's avatar
Ste4en
Frequent Visitor
3 years ago
Solved

Filter in a Measure

I have a list of running hours for a piece of equipment for every period/week. I use the following Measure to generate a cummulitive running hour curve:

CummulitiveMHbyPeriod =

CALCULATE(
    SUM('Distribution'[Period Values]),
    FILTER(
        ALLSELECTED('Distribution'[Dates]),
        ISONORAFTER('Distribution'[Dates], MAX('Distribution'[Dates]), DESC)
)
 
I now have two pieces of equipment in the same list and I want a seperate cummultive curve for each piece. I tried to edit the same measure above but add a filter to only select the records for EquipA; and then copy it and edit it to select EquipB. I need to see both together on one axis so a slicer or visual filter which shows one at a time doesnt work . How can i achieve this.
 
Thanks
 
  • SOLUTION FROM ChatCPT in case anyone sees this.

     

    CumulativeMH_EquipA =
    CALCULATE(
    SUM('Distribution'[Period Values]),
    FILTER(
    ALLSELECTED('Distribution'[Dates]),
    ISONORAFTER('Distribution'[Dates], MAX('Distribution'[Dates]), DESC)
    ),
    'Distribution'[EquipmentType] = "EquipA"
    )

2 Replies