Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.