Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I need a small help in creating new tables based on the column headers of existing table
For example if i have the following existing table
Number | T1 | T2 | T3 | Avl |
5645 | X | X | Y | |
3241 | X | X | Y | |
7592 | N | |||
1643 | X | Y | ||
2549 | X | Y | ||
4759 | N | |||
6247 | X | X | Y | |
8713 | X | Y | ||
9437 | X | N |
I need a new table with the selected column headers from the existing table as follows
T_ID |
T1 |
T2 |
T3 |
BR
Mechi 🔧
Solved! Go to Solution.
@Mechi Try Below
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc3BCcAwCIXhXTznEn1qs0TPLSH7r9HQFG0pRIQP+dM7qUGp0DHnWSeN0kkYNS3dtfHy9fZbq0GC8pgVLePBmJF/wxj++i6uN6+S4eAG8Q/PyrgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Number = _t, T1 = _t, T2 = _t, T3 = _t, Avl = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"T1", type text}, {"T2", type text}, {"T3", type text}, {"Avl", type text}}),
Custom1 = List.Select(Table.ColumnNames(#"Changed Type"),each Text.StartsWith(_,"T")),
#"Converted to Table" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.
@AnkitBI , Thanks for the Code
But i needs to create this table outside of Edit Query, Would be great help if i can able to do this in Modelling --> New Table using DAX formulas
BR
Mechi 🔧
Hi @Mechi ,
Currently, using DAX to extract column headers is not possible, you need to use M Query.
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |