Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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") <> "-")))
@Anonymous 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}))
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 8 | |
| 7 | |
| 5 |