The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the data in this format
ID | SN | Item Description | Start Date | Month 1 | Month 2 | Month 3 |
110 | 1 | Printer cartridge | 1 Apr 2020 | 10 | 20 | 0 |
111 | 2 | Ruler | 1 Nov 2020 | 20 | 30 | 5 |
How do I unpivot and fill in the month so that the table looks like this
ID | SN | Item Description | Start Date | Month | Quantity |
110 | 178 | Printer cartridge | 1 Apr 2020 | 1 Apr 2020 | 10 |
110 | 178 | Printer cartridge | 1 Apr 2020 | 1 May 2020 | 20 |
110 | 178 | Printer cartridge | 1 Apr 2020 | 1 Jun 2020 | 0 |
111 | 2 | Ruler | 1 Nov 2020 | 1 Nov 2020 | 20 |
111 | 2 | Ruler | 1 Nov 2020 | 1 Dec 2020 | 30 |
111 | 2 | Ruler | 1 Nov 2020 | 1 Jan 2021 | 5 |
Solved! Go to Solution.
Hi @gancw1 ,
First select columns "ID", "SN", "Item Description", "Start Date" and choose unpivot other columns.
Then create a new column with this formula:
Month =
Date.AddMonths([Start Date],Number.FromText(Text.End([Attribute],1))-1)
If I answered your question, please mark it as a solution to help other members find it more quickly.