cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
NickDSL
Helper I
Helper I

Pivoting Columns into one row

I have data like below.

ProductsDateValue
11/1/202310
21/1/202310
11/2/202320
21/2/202320
11/3/202330
21/3/202330
11/4/202340
21/4/202340
11/5/202350
21/5/202350

 

I'm trying to pivot into into this table below.

Date12
1/1/20231010
1/2/20232020
1/3/20233030
1/4/20234040
1/5/20235050

 

When I do Pivot columns I get this below:

Date12
1/1/202310null
1/1/2023null10
1/2/202320null
1/2/2023null20
1/3/202330null
1/3/2023null30
1/4/202340null
1/4/2023null40
1/5/202350null
1/5/2023null50

 

There are other columns and this is a heavily simplified version as I cannot share the exact data.

 

If anyone has any tips or trick on how I can get to my goal (imaged below here again) I would greatly appreciate it!

Date12
1/1/20231010
1/2/20232020
1/3/20233030
1/4/20234040
1/5/20235050
1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

= Table.Pivot(Table.TransformColumnTypes(Source, {{"Products", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(Source, {{"Products", type text}}, "en-US")[Products]), "Products", "Value", List.Sum)

View solution in original post

1 REPLY 1
AlienSx
Super User
Super User

= Table.Pivot(Table.TransformColumnTypes(Source, {{"Products", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(Source, {{"Products", type text}}, "en-US")[Products]), "Products", "Value", List.Sum)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors