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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
jeesan1234
Frequent Visitor

Pivot data to be used in Power BI

What is the best way to pivot the following data in excel or Power BI , so I can use it to creat visuals:

 JanuaryFebruaryMarch
 2nd - 4th5th - 11th12th - 18th19th - 25th26th - 1st2nd - 8th9th -15th16th - 22nd23rd - 1st2nd - 8th9th - 15th 16th - 22nd  23rd - 28th 29th - 2nd
Cargo             211             251             555             443             251             259             259             259             259             266             266             554             266             107
Energy               16               40               40               40               40               67               37               37               37               38               38               38               38               65
Casualty Treaty             179             448             448             448             448             432             432             432             432             429             429             429             429             172
Casualty Direct               85             212             212             212             212             215             215             215             215               36               36               36               36               15
Healthcare               49             121             111             121             545             134             134             134             134             322             138             138             138               55

 

As the months are split by different weeks. I need to sum the data for each month for few visuals in Power BI, and also show visuals with data split by weeks. I am not sure how to upload this data as there are essentially 2 different column headers when I get this data.

1 ACCEPTED SOLUTION
audreygerred
Super User
Super User

Hi! In Power Query, I would suggest just using one of the headers to start out. For the purposes of this exercise, I will use the weeks as the header. 

audreygerred_1-1729605314016.png

 

Now, we need to unpivot the data. I clicked on Category, then went to the Transform ribbon, then selected the down arrow on Unpivot Columns and selected Unpivot other columns. Now, the data looks like this:

audreygerred_2-1729605403898.png

To get your month names back you can either add in a table with the week buckets in one column and the name in another, then merge that together with the above, or you can add in a conditional column and type out what you want:

audreygerred_3-1729605593636.pngaudreygerred_4-1729605620575.png

Then, load your data, make your measures and build your visuals 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
audreygerred
Super User
Super User

Hi! In Power Query, I would suggest just using one of the headers to start out. For the purposes of this exercise, I will use the weeks as the header. 

audreygerred_1-1729605314016.png

 

Now, we need to unpivot the data. I clicked on Category, then went to the Transform ribbon, then selected the down arrow on Unpivot Columns and selected Unpivot other columns. Now, the data looks like this:

audreygerred_2-1729605403898.png

To get your month names back you can either add in a table with the week buckets in one column and the name in another, then merge that together with the above, or you can add in a conditional column and type out what you want:

audreygerred_3-1729605593636.pngaudreygerred_4-1729605620575.png

Then, load your data, make your measures and build your visuals 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.