Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
Please refer to the attached screenshot. I am not sure how to best prepare this data for creating Visuals. I guess I have to create on column State with the data from the first Row, and one other column L-O with the data from the second Row. I tried different transformation steps but no luck.
Any ideas please
Thank you
Sabedin
Solved! Go to Solution.
You should find sth on this blog about doing this with the UI.
But I prefer a formula-solution (for performance-reasons, especially if your data is large):
let // Replace this with your source-data
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRcgRiJyB2VorViVZySSxJBXJ8EvNSEJRzfl4JWNbAUA+IjAwMzYGihkBsBMTGECkjZCkDkByIMDaAyBqjyEKkIfJABbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Spalte1 = _t, Spalte2 = _t, Spalte3 = _t, Spalte4 = _t]), Rename = Table.RenameColumns(Source, List.Transform(Table.ColumnNames(Source), each {_, Text.Combine({Record.Field(Source{0}, _), Record.Field(Source{1}, _)}, "--")})), RemoveTopTwo = Table.Skip(Rename,2), // Depending on how the blanks in your first fields come in, you might need to chang {"--DATE"} to {"DATE"}
UnpivotOthers = Table.UnpivotOtherColumns(RemoveTopTwo, {"--DATE"}, "Attribute", "Value"), Split = Table.SplitColumn(UnpivotOthers,"Attribute",Splitter.SplitTextByDelimiter("--", QuoteStyle.Csv),{"Country", "Category"}) in Split
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
You should find sth on this blog about doing this with the UI.
But I prefer a formula-solution (for performance-reasons, especially if your data is large):
let // Replace this with your source-data
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRcgRiJyB2VorViVZySSxJBXJ8EvNSEJRzfl4JWNbAUA+IjAwMzYGihkBsBMTGECkjZCkDkByIMDaAyBqjyEKkIfJABbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Spalte1 = _t, Spalte2 = _t, Spalte3 = _t, Spalte4 = _t]), Rename = Table.RenameColumns(Source, List.Transform(Table.ColumnNames(Source), each {_, Text.Combine({Record.Field(Source{0}, _), Record.Field(Source{1}, _)}, "--")})), RemoveTopTwo = Table.Skip(Rename,2), // Depending on how the blanks in your first fields come in, you might need to chang {"--DATE"} to {"DATE"}
UnpivotOthers = Table.UnpivotOtherColumns(RemoveTopTwo, {"--DATE"}, "Attribute", "Value"), Split = Table.SplitColumn(UnpivotOthers,"Attribute",Splitter.SplitTextByDelimiter("--", QuoteStyle.Csv),{"Country", "Category"}) in Split
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 51 | |
| 39 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 95 | |
| 78 | |
| 34 | |
| 28 | |
| 25 |