Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello - relatively new to Power BI, so I am hoping my question is an easy one. I have a folder of CSV data extracts, all in the exact same format, that I want to pull into Power BI. With each CSV extract, the first row is a row of selections I made when pulling the data. The second row is the row I want to use as data headers. In the first row is the date I want pulled and added as a custom column. The data currently looks like the example below:
Category=[ALL] | Subcategory=[ALL] | Brand=[ALL] | Viewing=[1/1/21 - 1/1/21] |
Item | Item Description | Sales $ | Sales U |
354 | Apple | 10.25 | 4 |
640 | Banana | 3.75 | 2 |
887 | Pear | 11.32 | 5 |
And I would like to transform the data into the following (the bold row being the column headers)
Item | Item Description | Sales $ | Sales U | Date |
354 | Apple | 10.25 | 4 | 1/1/21 |
640 | Banana | 3.75 | 2 | 1/1/21 |
887 | Pear | 11.32 | 5 | 1/1/21 |
Hoping that making this change would apply to each CSV extract in the folder. Thanks for the help in advance!
Solved! Go to Solution.
@ChrisFromOhio I create a dummy pbix file using two csv files from my computer, see attached. and tweak it as you see fit.
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@ChrisFromOhio I create a dummy pbix file using two csv files from my computer, see attached. and tweak it as you see fit.
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@ChrisFromOhio you can create a custom function and then pass the content to the function, and that function will take the transformation, remove the first row and rest of the transformation.
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@ChrisFromOhio there are lots of posts on this
My favorite clean and simple way to combine csv files in Power BI – data witches (data-witches.com)
Import all CSV files from a folder with their filenames in Power BI - P3 Adaptive
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k I've seen some of these posts, but my question pertains to adding a column based on the first row of data, then removing it and using the second column as my headers
@ChrisFromOhio , In power query, remove rows =1
then use the first row s header. Option under home menu
https://www.c-sharpcorner.com/article/removing-unnecessary-rows-using-power-query-in-power-bi/
@amitchandak I know how to remove a row then make the next row a header, but before I remove the row I want to pull data from it into a column, then use the next row as the header.
User | Count |
---|---|
59 | |
58 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
40 | |
39 |