Here you go,
Duplicate Data Source
On second data source (Orange), Duplicate "Date ID"
Rename "Date ID" to "Date ID original"
Rename "Date ID(copy)" to "Date ID" // for the purpose of auto data relationships
On primary Data source,
Create two new calculatd fields.
[Var to PY ($) ]
SUM([Actual])-SUM([Sample Data (SampleData_PriorYear) (copy)].[Actual_Prev_Year])
[Var to PY (%)]
[Var to PY ($) ]/SUM([Sample Data (SampleData_PriorYear) (copy)].[Actual_Prev_Year])
PriorYear_9.2.twbx 41.3 KB
All is fine with this sample dataset but be careful. This technique only works as long as the primary source covers all potential combination of dimensions used in the view. If for example in the current period there is no values in a certain category on which data is blended but it exists in previous year's period then that PY data will be filtered out.
Also your wb extract doubles in size which in some cases may also be a concern. There are alternative ways - the attached shows the same using table calculations.
Edited: modified date filter a bit and removed the redundant year dimension and grand totals added:
PriorYear_9.2.twbx 51.2 KB
Thank you for following up, Lulasz.