Approach 2: Working but it's static as need to prepare the table before hand in the script
SummaryTable:
Load Date, Product, sum(Amount) as sum_Amount group by Date, Product
Created a SummaryTableCopy table with Date as the common columns
Pivot table - row: Product, column: ProductCopy
Measure: Correl(sum_Amount, sum_Amount_Copy)
Question
Is there any way to get the Approach 1 works as I have other dimensions like Product, Sub_Product, Locations, Type etc. and the correlations I need can be dynamic like below and don't want to create multiple summary tables for each