Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I've got a series of date excel files where there are a few misc rows of data at the top, then has the dates listed horizonally, one per column (see picture below). I'd like to write a query to combine and transform these files in Power BI, which are all in a shared folder, after they are unpivoted. I can go into the "Transform Sample File" and get it to work using a series of steps, but the trasnformations only work for the first file. Looking at the error on the subsequent files it appears the error comes when I promote the "Reg Hours" row below as headers the second and third files error out due to not having the same header names (because they are for 1-feb and not 1-Jan for example). Is there any way to fix this?
Solved! Go to Solution.
Hi @mwvoves
I've attached a PBIX file for you.
Firstly, you want to Transpose the table (in the Transform tab of Power Query), then Unpivot.
You will have to delete your second Applied Step though, as Power BI is automatically determining your first header.
Let me know whether the attached is what you are after. The outputs turn out like this:
Hope this helps!
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @mwvoves
Rather than promoting the Dates as "Headers," you should unpivot the columns so that your result is a "Dates" column and an "Amount" column. This will then give you the basis of creating a relationship to a Date table and allow you to also undertake far better analysis comparatively.
Let me know if you'd like further explanation k!
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Here's how the table loads into power BI- are you saying I should unpivot the table as is (instead of removing the top 2 rows/promoting the first row as headers)?
Hi @mwvoves
I've attached a PBIX file for you.
Firstly, you want to Transpose the table (in the Transform tab of Power Query), then Unpivot.
You will have to delete your second Applied Step though, as Power BI is automatically determining your first header.
Let me know whether the attached is what you are after. The outputs turn out like this:
Hope this helps!
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Yes I was able to get it to work after using the transpose step, thank you!!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
13 | |
12 | |
11 | |
8 |
User | Count |
---|---|
42 | |
25 | |
14 | |
14 | |
12 |