2 years ago

#73661

test-img

Smith Jack

Show Last 12 Month and Limit only year select

I create DAX in Microsoft Power BI for display Last 12 month for Chart and I need show only year select. How to solved it. My code follow:

    Last 12 Month = 
VAR MaxFactDate = CALCULATE ( MAX (Query1[A_Query_Date]), ALL ( DateCalendar ) )
VAR FDate = ENDOFMONTH ( DateCalendar[Date]) 
VAR Edate = EDATE ( FDate, -12 ) 
RETURN
    IF (MaxFactDate <= MAX ( DateCalendar[Date] ) && MaxFactDate > Edate,
        CALCULATE(1-DIVIDE(SUM(Query1[Lapse_Cases]),SUM(Query1[NB_CASES])), ALL ( DateCalendar )
    ))
    ```

powerbi

powerbi-desktop

0 Answers

Your Answer

Accepted video resources