I'm facing a challenge in power bi where I need to join Table 1 & Table 2 but the catch is Table 2 needs to be pivoted before joining.
How to build the output table when the Table 2 rows will be increasing daily
Your desired result needs a combination of Unpivot, Merge and Pivot steps.
You can follow the following steps:
Date column to Text type.Sales in KG & Sales in Amount from Table 2 - it will create 2 columns called Attribute & ValueDate & Attribute to create a new column (lets call it columnHeaders) - this will be in the format - 1/3/22 Sales in KG, 1/3/22 Sales in Amount ...Table 1 into Table 2 and expand the Product Name column
Product Code, columnHeaders, Value, & Product NamecolumnHeader using the Value column for valuesYou should have your desired result.
I dont know why you try to unpivot your table. Just use a Matrix visualization:
Model relationship:
Imput data + output:

sum of kg = CALCULATE(sum(Table2[Sales in kg]))