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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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