March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am brand new to Power Query and have been stuck on this problem for the past 5 days. I've tried watching tons of YouTube videos (especially by Goodly), but the solutions provided don't help my specific case. I feel that this is an extremely simple problem to fix, I just can't seem to make it happen.
Attached in the picture, you'll find columns with Forecast and Actual, Months, and Quantities.
I'm trying to convert this into a list that looks like:
Months / Forecast / Actual
- the quantities are below the forecast and actual
How can I make this happen?
I really appreciate ANY help that I can get.
Solved! Go to Solution.
No worries 🙂
OK, so if the values in column2 are unique for each value in column1, then a pivot-operation would do the job:
1) Check Column1
2) go to Transform tab and choose "pivot column"
3) Select Column3 for the "Values Column"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Good to see 🙂
The values in column1 are text values, so you need an additional helper column for the sorting.
Unfortunately - at least to my knowledge - there isn't a native function that derives the month number from a text string. So the formula is a bit more complicated.
Add a new column with the following formula
Date.Month(Date.FromText("2000-" & [Column1] & "-01"))
You can sort by it in the query editor.
But more importantly: You can use this column as the sort-by-column for your Column1 later in the data model.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
This was GOLD! Thank you so, so much! 😍
No worries 🙂
OK, so if the values in column2 are unique for each value in column1, then a pivot-operation would do the job:
1) Check Column1
2) go to Transform tab and choose "pivot column"
3) Select Column3 for the "Values Column"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
IT WORKED!!! OMG THANK YOU!!!
As a last question, how do I get the pivoted months to be in order?
Hi @meikastler ,
that doesn't look to me like so.
In row 11 we have the 2nd jan and the column left to it shows "Forecast".
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
OMG! I did a Replace Values and the extra Jan is supposed to be November and the extra Feb is supposed to be December. I apologize! I took the photo before I fixed that particular error 😣
Hello @meikastler ,
What about the jan amounts in row 1 and 11: Should they be aggregated to 700 or kept separately?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
They need to be kept seperately. The first January is for the Forecast of a particular product quantity. The second January is for the Actual product quantity.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.