0

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 )
    ))
    ```
  • Hi and welcome Smith Jack, please provide a reproducible MVE (minimal, workable example). [In this thread](https://stackoverflow.com/a/70773971/12242625) you'll find two ways how you easily can share data. – Marco_CH Jan 20 '22 at 08:20
  • If you wants to show months from selected year only, why last 12 month issue raised? Its always 12 month, right? – mkRabbani Jan 20 '22 at 08:56

0 Answers0