Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate and plot YoY over multiple years

I have 3 years of revenue data (2019 - 2021) for a group of vendors.

The table name is 'data', and the fields are [Year], [Vendor], [Vendor Revenue].

 

I am calculating market share and YoY revenue change for each vendor, as follows:
[Revenue] = SUM('data'[Vendor Revenue])  // currency

[Market Share] = DIVIDE( [Revenue], CALCULATE( [Revenue], ALL('data'[Vendor])), 0)  // percent

[YoY Change] = DIVIDE( [Revenue], CALCULATE( [Revenue], SAMEPERIODLASTYEAR('data'[YEAR])), 0)

 

I want to be able to plot the data using a scatter chart, with each vendor appearing twice one marker for 2019-2020 and and one for 2020-2021, but I'm only getting the 2020-2021 data points.

 

I know I could do this with calculated columns in the data table, but I'm hoping I can make it dynamic since I want to add a field for product and be able to dynamically filter.

 

If my question doesn't make sense, let me know and I'll provide sample data.

 

Thanks in advance.

2 Replies