cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlwaysBI
Frequent Visitor

pivot table with dynamic calculation

Hi

I am new to PowerBI, I have a table in below and would like to pivot it with a subtotal by type.  I have created a measure, If I want to pivot the table by SKU how can I archive the result I want? 

 

First Class Total =
VAR ClassData= SUMMARIZE(FILTER(NEWTable,NEWTable[Type] = "First Class"),NEWTable[Outlet],"Total",SUM(NEWTable[value]))
RETURN
SUMX(ClassData,[Total])

 

NEWTable

OutletTransaction_DateTypeProductvalue
LOLOMAYA21/3/2019First ClassSKU A1
LOLOMAYA21/3/2019First ClassSKU B1
LOLOMAYA21/3/2019First ClassSKU C0
LOLOMAYA21/3/2019Second ClassSKU D1
LOLOMAYA21/3/2019Second ClassSKU E1
LOLOMAYA21/3/2019Second ClassSKU F1
LULULALA21/3/2019First ClassSKU A0
LULULALA21/3/2019First ClassSKU B0
LULULALA21/3/2019First ClassSKU C1
LULULALA21/3/2019Second ClassSKU D0
LULULALA21/3/2019Second ClassSKU E0
LULULALA21/3/2019Second ClassSKU F0

 

Result

Transaction_DateOutletTotal First ClassSKU ASKU BSKU CTotal Second ClassSKU DSKU ESKU F
21/3/2019LOLOMAYA21103111
21/3/2019LULULALA10010000
0 REPLIES 0

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.