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
In the Advanced Editor, I havea step name 'SurplusCols' set to read from this named range...
...
Solved! Go to Solution.
When you're deleting columns with the help of the UI, it's generating a hard coded list with text values for each column name. In the M language to create a text value you need to enter your sting in between quotes, that's why you see them there in the code.
But when you're bringing in text values, there is no need for quotes.
Note that with your method if you're supplying Power Query a single string containing mutiple column names, you'll need to split that up into a list containing separate list items. For example: Text.Split(SurplusCols, ", ")
Ps. If this helps solve your query please mark this post as Solution, thanks!
Hi @m_dekorte - thanks so much for your response...that's working!
For reference, here's the working solution:
1) Named range 'surplusColumnns' in Excel, with three columnns reference - Column A, Column B and Column C
2) Definition of 'SurplusCols' parameter in the step editor, showing the three columns pulling through from the named range:
3) 'Remove all surplus columns' step in the step editor, showing how I've used the 'SurplusCols' paramater in the 'Table.RemoveColumns' function to dynamically remove the columns referenced in the named range:
Really appreciate your help on this one!
Stuart
Hi @m_dekorte - thanks so much for your response...that's working!
For reference, here's the working solution:
1) Named range 'surplusColumnns' in Excel, with three columnns reference - Column A, Column B and Column C
2) Definition of 'SurplusCols' parameter in the step editor, showing the three columns pulling through from the named range:
3) 'Remove all surplus columns' step in the step editor, showing how I've used the 'SurplusCols' paramater in the 'Table.RemoveColumns' function to dynamically remove the columns referenced in the named range:
Really appreciate your help on this one!
Stuart
When you're deleting columns with the help of the UI, it's generating a hard coded list with text values for each column name. In the M language to create a text value you need to enter your sting in between quotes, that's why you see them there in the code.
But when you're bringing in text values, there is no need for quotes.
Note that with your method if you're supplying Power Query a single string containing mutiple column names, you'll need to split that up into a list containing separate list items. For example: Text.Split(SurplusCols, ", ")
Ps. If this helps solve your query please mark this post as Solution, thanks!
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.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |