Forum Discussion

Claudioffj's avatar
Claudioffj
Regular Visitor
2 years ago
Solved

Filter current month and previous months

I have a table as shown below. It is possible to create calculated column so that when selecting month 3, for example, the result is month 3 plus months 2 and 1? IDProj   Month  Year        Stat...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Claudioffj ,

    Please try this way:
    Add a new table for creating the slicer:

    Use this DAX to create the measure:

    Measure = 
    VAR _maxmonth = CALCULATE(MAX([Month]), FILTER(ALLEXCEPT('Table', 'Table'[ID]), [Month] <= SELECTEDVALUE(Slicer[Month])))
    RETURN
    IF( MAX([Month]) = _maxmonth, 1, 0)

    Make the settings as shown in the figure below:

    The final output is as below:



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