Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Power query learner here. I am trying to create a custom function. I have a table which after initial processing still contains column headers that start with the text "Column". I wanted to invoke this function on the last step so then I can get rid of all these columns that start with "Column".
I used below function but what it is doing is returning a table with all columns that start with "Column" text rather than removing it. Any idea how to fix this?
(InputQueryTable as table) =>
let
Source = #"InputQueryTable",
#"Column Names" = Table.ColumnNames(Source),
#"Columns Containing String" = List.FindText(#"Column Names", "Column"),
//#"Columns Containing String" = List.Contains( #"Column Names", "", Text.StartsWith( "Column") ),
//#"Columns Containing String" = List.FindText(#"Column Names", Text.StartsWith( "Column") ),
#"List Difference" = List.Difference( #"Column Names", #"Columns Containing String"),
#"Removed Columns" = Table.RemoveColumns(Source, #"List Difference")
in
#"Removed Columns"
Solved! Go to Solution.
Hi,
found the answer myself. Updated code below.
sum(Earned Hours ) / Sum(CurrentEst)
(InputQueryTable as table) =>
let
Source = #"InputQueryTable",
#"Column Names" = Table.ColumnNames(Source),
#"Columns Containing String" = List.FindText(#"Column Names", "Column"),
#"Removed Columns" = Table.RemoveColumns(Source, #"Columns Containing String")
in
#"Removed Columns"
Hi,
found the answer myself. Updated code below.
sum(Earned Hours ) / Sum(CurrentEst)
(InputQueryTable as table) =>
let
Source = #"InputQueryTable",
#"Column Names" = Table.ColumnNames(Source),
#"Columns Containing String" = List.FindText(#"Column Names", "Column"),
#"Removed Columns" = Table.RemoveColumns(Source, #"Columns Containing String")
in
#"Removed Columns"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
48 | |
19 | |
13 | |
11 |