Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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. 

  • Hello Anonymous ,

     

    Please try following steps -

     

    Step 1- Go to transform data.

     

     

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

     

     

    Step 3- Click on  unpivot columns in transform tab.

     

     

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

     

    Cheers,

    Shishir

  • 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.

4 Replies

  • Hello Anonymous ,

     

    Please try following steps -

     

    Step 1- Go to transform data.

     

     

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

     

     

    Step 3- Click on  unpivot columns in transform tab.

     

     

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

     

    Cheers,

    Shishir

    • Anonymous's avatar
      Anonymous
      Not applicable

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

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Most Valuable Professional

    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's avatar
      Anonymous
      Not applicable

      Thank you, Vijay!