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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
leonardng
New Member

price history table

Hi All,

 

I have a query on how to create a table. Given the situation where I have the data as shown below.

 

Item        Units          Year

A             1                2017

A             1                2016

A             1                2015

B             1                2017

B             1                2016

B             1                2015

 

 

I would like to create a table that looks like this on power BI.

 

Item               2015                     2016                         2017

A                    1                           1                               1

B                    1                           1                               1

 

How should I approach this table? Please advise.

 

Thank you.

 

1 ACCEPTED SOLUTION
PowerAnalytics
Advocate II
Advocate II

Hi Leonard,

 

You can import your Query exactly as is and then:

 

Edit Query

Transform

Select the Year column

Select Pivot Column

Select Units as the Values Column and ok

 

See here how to find the Transform -> Pivot Column feature: http://www.radacad.com/wp-content/uploads/2016/04/2016-04-07_00h40_54.png


This will do exactly what you need. If you have any trouble I can send you a PBIX sample file.

View solution in original post

1 REPLY 1
PowerAnalytics
Advocate II
Advocate II

Hi Leonard,

 

You can import your Query exactly as is and then:

 

Edit Query

Transform

Select the Year column

Select Pivot Column

Select Units as the Values Column and ok

 

See here how to find the Transform -> Pivot Column feature: http://www.radacad.com/wp-content/uploads/2016/04/2016-04-07_00h40_54.png


This will do exactly what you need. If you have any trouble I can send you a PBIX sample file.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.