Hi!
I have to produce a pivot table with years in columns, and I need to include a way of showing the rates of the values between the years shown in the table. Something like this on a simple example:
TablesExample2.png
Here the rate is calculated outside the table, but I can't use that because as soon as the filter on the years changes, the formulas for the rates stop working. Furthermore, I could need to dynamically add rate columns as the filter on the year shows more than two years, like on the second table here:
TablesExample3.png
I could try to do it with VBA, detect changes in the filters and change the formulas and add/remove/format columns accordingly, but the file is going to be distributed and I'm not sure if the policy at work allows for books with macros. Also, the column(s) would still be outside the table as such, although I could format it to look like it belonged, but that's not the point. I'm thinking DAX, but I'm a novice at DAX programming, so I'd appreciate any help. I don't know how to program a measure to grab the values of the shown year columns, I don't know how to show the rates as "independent" columns inside the table, and I don't know if it's even possible to increase/decrease the number of two-year rate columns as the number of years shown in the filter increase/decrease.
I'm attaching the little example shown in the pictures, in case anyone wants to add anything to it.
Many thanks in advance!
Best,
David
Bookmarks