Forum Discussion

dharish20240911's avatar
dharish20240911
New Member
1 year ago
Solved

How to Highlight Past months

Highlight the past months in Line and stacked column chart using DAX.
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi dharish20240911,
    Thanks for Kaviraj11 reply.
    You can try the following steps
    Sample data

    Date Value1 Value2
    5//1/2024 5 7
    6/1/2024 4 8
    7/1/2024 7 4
    8/1/2024 3 9
    9/1/2024 9 5

    Create a mesasure

     

    IsCurrentMonth = 
    IF(
        MONTH(SELECTEDVALUE('Table'[Date])) < MONTH(TODAY()),
        "Red",
        "Black"
    )

     

    Apply the measure to the format


    Final output

     

    Best regards,
    Albert He


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