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

Pivot data from excel to PowerBI

HI friends,

I have a data set with a fact file and a date file. In the fact file, i have some fields including:

T_Date, Product_id, Province_id,Amount_type, Amount,

1/2/2016, 1123,222, Target, 1998842$

1/2/2016, 1123,222, Actual, 2298446$

1/2/2016, 1123,222, GrossSales, 354000$

5/2/2016, 531,212, Target, 1998842$

.....

NoW i want to create a new table in power bi to pivot the fact file looks like:

T_Date, Product_id, Actual, Target,GrossSales

1/2/2016, 1123, 223,2298446$,1998842$,354000$

......

 

Could anyone give me the solution to do that!>

 

Thanks,

Best regards,

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@MichaelJackpbi Go to power bi desktop query editor,

 

1. Highlight both Amount_type and Amount columns

2. Under Transform tab click Pivot Columns

3. Apply as shown below.

 

Capture.PNG

View solution in original post

2 REPLIES 2
ankitpatira
Community Champion
Community Champion

@MichaelJackpbi Go to power bi desktop query editor,

 

1. Highlight both Amount_type and Amount columns

2. Under Transform tab click Pivot Columns

3. Apply as shown below.

 

Capture.PNG

You don't need to physically create a new table of data. You can just display the data this way. Add a matrix to the canvas and then add you first 2 columns to the rows and the last 3 columns into the values



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.