Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello good people,
I am trying to find percentage of certain text value in another column. Can someone help please?
| Continent | Status |
| Asia | In |
| Asia | In |
| Asia | In |
| Asia | In |
| Asia | Out |
| Asia | Out |
| Africa | Out |
| Africa | Out |
| Africa | In |
| Africa | In |
Result I am looking for percentage of Continent+Status in a new column.
| Continent | Status | Percentage |
| Asia | In | 40% |
| Asia | In | 40% |
| Asia | In | 40% |
| Asia | In | 40% |
| Asia | Out | 20% |
| Asia | Out | 20% |
| Africa | Out | 20% |
| Africa | Out | 20% |
| Africa | In | 20% |
| Africa | In | 20% |
Here, Asia In is 40%, where Asia Out is 20% , followed by Africa Out 20% so as Africa In 20%.
Thank anyone for help in advance.
Hi AlienSx,
Many thanks, yes it works, however, in my real table, there are many columns, not possible to do with 'group'. Do you have any solution without 'group' ? thanks
@shparvez expand as many columns as you want. Expand all of them!
expand = Table.ExpandTableColumn(pct, "rows", Table.ColumnNames(source_table))
While 'grouping' , I have to mentions all other columns names, not? Thats very difficult, as I have too many columns.
g = Table.Group(
source_table,
{"Continent", "Status"},
{{"rows", each _}, {"Percentage", each Table.RowCount(_), Int64.Type}}
@shparvez no, don't do that. Leave them alone. That's the idea behind Table.Group. Just change expand step.
Hi,
Suppose the table is as below
Column1, Column2, Column3, Column4, Column5, Column6..... ColumnN
I want to find percetage for values of Column 5 only. Can you rewrite the code please without mentioning any other columns ? Thank you in advance.
g = Table.Group(
source_table,
"Column5",
{{"rows", each _}, {"Percentage", each Table.RowCount(_), Int64.Type}}
)[[rows], [Percentage]],
ttl = List.Sum(g[Percentage]),
pct = Table.TransformColumns(g, {"Percentage", each _ / ttl}),
expand = Table.ExpandTableColumn(pct, "rows", Table.ColumnNames(source_table))
Hi ,
An error message appears - "Expression.Error: The “Percentage” field already exists in the record."
hi
hello, @shparvez
g = Table.Group(
source_table,
{"Continent", "Status"},
{{"rows", each _}, {"Percentage", each Table.RowCount(_), Int64.Type}}
)[[rows], [Percentage]],
ttl = List.Sum(g[Percentage]),
pct = Table.TransformColumns(g, {"Percentage", each _/ttl}),
expand = Table.ExpandTableColumn(pct, "rows", {"Continent", "Status"}, {"Continent", "Status"})
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.