Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello to all,
I need some help for transforming a simple table. We are getting a table from an automation and aren´t able to change the structure in the datasource, so we have to do it in Power BI.
It´s a table with one Column like you can see below:
We need to count the values between the Project´s. The value format is text and they have allways the value "value" (for example).
Is there a way to transform it to multiple project columns? The "Project cells" have alaways the same Text and it allaways the same number of projects cells, but the count of values between is different.
Has anyone an idea how we can count the values between or transform it to multiple columns by project?
Thank you very much!
Column1
| Project 1 |
| Value |
| Value |
| Value |
| Project 2 |
| Value |
| Value |
| Value |
| Value |
| Project 3 |
| Value |
| Value |
| Value |
| Value |
| Value |
| Project 4 |
| Value |
| Value |
| Value |
Solved! Go to Solution.
Table.Group: Exploring the 5th element in Power BI and Power Query – The BIccountant
Here's something to get you started
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVIrViVYKS8wpTcXJgqk1IkItpi5jknRh6jchpDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"Count", each Table.RowCount(_), Int64.Type}},GroupKind.Local,(x,y)=>Number.From(x<>y))
in
#"Grouped Rows"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
Please provide a more detailed explanation of what you are aiming to achieve. Please show the expected outcome.
Hi @Davpek ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Transform the data as below screenshot in Power Query Editor
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVIrViVYKS8wpTcXJgqk1IkItpi5jknRh6jchpDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Conditional Column" = Table.AddColumn(Source, "Projects", each if Text.Contains([Column1], "Project") then [Column1] else null),
#"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Projects"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each not Text.Contains([Column1], "Project")),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows",{{"Column1", "Values"}})
in
#"Renamed Columns"
2. Create a table visual with the settings in below screenshot
If the above one can't help you get the desired result, please provide more sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thank you very much. This worked for me!👍
Hi @Davpek ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Transform the data as below screenshot in Power Query Editor
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVIrViVYKS8wpTcXJgqk1IkItpi5jknRh6jchpDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Conditional Column" = Table.AddColumn(Source, "Projects", each if Text.Contains([Column1], "Project") then [Column1] else null),
#"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Projects"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each not Text.Contains([Column1], "Project")),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows",{{"Column1", "Values"}})
in
#"Renamed Columns"
2. Create a table visual with the settings in below screenshot
If the above one can't help you get the desired result, please provide more sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Table.Group: Exploring the 5th element in Power BI and Power Query – The BIccountant
Here's something to get you started
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVIrViVYKS8wpTcXJgqk1IkItpi5jknRh6jchpDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"Count", each Table.RowCount(_), Int64.Type}},GroupKind.Local,(x,y)=>Number.From(x<>y))
in
#"Grouped Rows"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
Please provide a more detailed explanation of what you are aiming to achieve. Please show the expected outcome.