cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Month name in Column

Hello, I have a table that provides information about a variety of products, the value of the quantity and the months. 

 

Example: 

 

ProductsJan Feb
Product A105
Product B27
Product C57

 

The table that comes from excel, looks a little bit like the table I am showing above but it has months for the whole year (Jan through Dec). I want to have a table that shows me this. 

 

ProductsQuantityMonth
Product A10Jan
Product B2Jan
Product C5Jan
Product A5Feb
Product B7Feb
Product C7Feb

 

The purpose of this format is to be able to have filter information by months. 

 

I am unaware if there is a way to do this in the same table. One inefficient way I found to accomplish this was to make a table for each month, unpivot the columns and create a fill down based on the column and then append the 12 different tables but this creates a lot of unnecesary tables and queries in my Power Bi.

 

Let me know if I need to clarify any information. 

2 ACCEPTED SOLUTIONS
Shishir22
Super User
Super User

Hello @Anonymous ,

 

Please try following steps -

 

Step 1- Go to transform data.

 

Shishir22_0-1651081645201.png

 

Step 2- Select All columns from Jan to Dec using shift.

 

Shishir22_1-1651081704759.png

 

Step 3- Click on  unpivot columns in transform tab.

 

Shishir22_2-1651081756491.png

 

Please mark it as solution if it resolves your issue. Kudos are also appreciated,

 

Cheers,

Shishir

Cheers,
Shishir

View solution in original post

Vijay_A_Verma
Super User
Super User

Just select your Products column (if there are other columns select them also but don't select month columns) - Right click - Pivot other columns

This will introduce dynamism in your query. Hence, if you currently have only Jan through May data, any month column which comes afterward will be automatically added when refreshed.

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

Just select your Products column (if there are other columns select them also but don't select month columns) - Right click - Pivot other columns

This will introduce dynamism in your query. Hence, if you currently have only Jan through May data, any month column which comes afterward will be automatically added when refreshed.

Anonymous
Not applicable

Thank you, Vijay!

Shishir22
Super User
Super User

Hello @Anonymous ,

 

Please try following steps -

 

Step 1- Go to transform data.

 

Shishir22_0-1651081645201.png

 

Step 2- Select All columns from Jan to Dec using shift.

 

Shishir22_1-1651081704759.png

 

Step 3- Click on  unpivot columns in transform tab.

 

Shishir22_2-1651081756491.png

 

Please mark it as solution if it resolves your issue. Kudos are also appreciated,

 

Cheers,

Shishir

Cheers,
Shishir
Anonymous
Not applicable

I was able to implement it in my data, this helps a lot. Thank you! 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors