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 all,
May I ask is there any way I could filter columns based on its name?
ID | Group | Cost 1 | Cost 2 | Price 1 | Price 2 |
1 | A | - | 0.8 | - | -0.11 |
2 | B | 0.4 | - | - | 0.23 |
3 | - | 0.5 | - | 0.6 | - |
4 | C | - | 0.4 | 0.1 | - |
5 | D | 0.6 | 0.2 | 0.54 | 0.57 |
In this case, is it possible to filter out "-" if columns' name contains "Price"?
I am trying this but still fail,
= Table.SelectRows(Source, each (List.Select(Table.ColumnNames(Source), each Text.Contains(_,"Price") <> "-")))
@Vera_33 if you could help?
Solved! Go to Solution.
= let col=List.Select(Table.ColumnNames(Source), each Text.Contains(_,"Price")) in Table.SelectRows(Source, each List.PositionOf(Record.ToList(Record.SelectFields(_,col)),"-")<0)
= let col=List.Select(Table.ColumnNames(Source), each Text.Contains(_,"Price")) in Table.SelectRows(Source, each List.PositionOf(Record.ToList(Record.SelectFields(_,col)),"-")<0)
@wdx223_Daniel may I have a further question?
Is it possible to achieve a similar outcome:
When the Columns name contains "price" then Change "Type number"
Great thanks if you have any idea!
=Table.TransformColumnTypes(PreviousStep,List.Transform(List.Select(Table.ColumnNames(PreviousStep),each Text.Contains(_,"price")),each {_,type number}))
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 |
---|---|
101 | |
52 | |
21 | |
12 | |
11 |