Forum Discussion

dommyw277's avatar
dommyw277
Icon for Helper V rankHelper V
1 month ago
Solved

Monthly Automatic Change

Hi I created a card called current month and one called previous month. They are refreshed every day, however when the month changes can the card automatically change rather than me manually picking...
  • Rupa01's avatar
    Rupa01
    1 month ago

    dommyw277 If Month_Year column is a calculated column it won't be visible in Power Query.

    So, you can create below two DAX Calulated Columns and use Month Category as a filter on the cards - 

    Date = DATEVALUE ( "01 " & [Month-Year] )

     

    Month Category = 
    VAR CurrentDate = TODAY()
    VAR PreviousMonthDate = EDATE(CurrentDate, -1)
    RETURN
    SWITCH(
        TRUE(),
        YEAR([Date]) = YEAR(CurrentDate)
            && MONTH([Date]) = MONTH(CurrentDate),
            "Current Month",
    
        YEAR([Date]) = YEAR(PreviousMonthDate)
            && MONTH([Date]) = MONTH(PreviousMonthDate),
            "Previous Month",
    
        [Month-Year]
    )

     

     

    💡 Helpful? Give a Kudos 👍 — keep the community growing
     Solved your issue? Mark as Solution ✔️ — help others find it faster

    Best regards,
    Rupasree Achari | BI & Fabric Analytics Engineer