Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

YoY Quick Measure - Date Issue

Hello,   I am trying to calculate Sales $ year over year change. I have my data by year however, the app will not allow me to add any data into the date field. I have read multiple articles and the...
  • V-lianl-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    Try measure like this:

    Measure =
    VAR year =
        MAX ( 'Table'[year] )
    VAR last_year_sale =
        CALCULATE (
            FIRSTNONBLANK ( 'Table'[sales], 1 ),
            FILTER ( ALLEXCEPT ( 'Table', 'Table'[vendor] ), 'Table'[year] = year - 1 )
        )
    RETURN
        DIVIDE ( MAX ( 'Table'[sales] ), last_year_sale )

    Sample .pbix 

     

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

  • aj1973's avatar
    aj1973
    6 years ago

    Sorry guys the Divide formula must be looking like this

     

    Sorry again

    Regards