Forum Discussion
Anonymous
6 years agoNot applicable
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...
- 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 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 6 years ago
Sorry guys the Divide formula must be looking like this
Sorry again
Regards
ryan_mayu
6 years agoSuper User
Anonymous
It's better to create a measure (writing DAX by yourself). You need a datetime table and create the relationship between your table and datetime table. Then you can use dateadd to get the previous year's value.
It will be better if you share the screenshot or sample file.
aj1973
6 years agoCommunity Champion
Hi,
The YoY measure is a Time Intelligent function, for that you need to create a Calendar table in order to use it proparly.
Regards