Hello, I have a table that provides information about a variety of products, the value of the quantity and the months.
Example:
Products | Jan | Feb |
Product A | 10 | 5 |
Product B | 2 | 7 |
Product C | 5 | 7 |
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.
Products | Quantity | Month |
Product A | 10 | Jan |
Product B | 2 | Jan |
Product C | 5 | Jan |
Product A | 5 | Feb |
Product B | 7 | Feb |
Product C | 7 | Feb |
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.
Solved! Go to Solution.
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.
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.
Thank you, Vijay!
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
I was able to implement it in my data, this helps a lot. Thank you!
User | Count |
---|---|
130 | |
81 | |
64 | |
57 | |
55 |
User | Count |
---|---|
213 | |
108 | |
86 | |
82 | |
76 |