Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hey,
I Just want to add a column to my table but I don't know how to write it on PBI.
thanks for everything.
Solved! Go to Solution.
Hi @dolevh,
Using below M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjYwUNJRMjLUdSwoAjJMLYyUYnWilUywCMcCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hours = _t, Month = _t, ID = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Hours", Int64.Type}, {"ID", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Epic %", each [Hours]/List.Sum(Table.SelectRows(#"Changed Type",(x)=>x[Month]=[Month] and x[ID]=[ID])[Hours])),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Epic %", Percentage.Type}})
in
#"Changed Type1"
And you will see:
Check my .pbix file attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Hi @dolevh,
Using below M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjYwUNJRMjLUdSwoAjJMLYyUYnWilUywCMcCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hours = _t, Month = _t, ID = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Hours", Int64.Type}, {"ID", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Epic %", each [Hours]/List.Sum(Table.SelectRows(#"Changed Type",(x)=>x[Month]=[Month] and x[ID]=[ID])[Hours])),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Epic %", Percentage.Type}})
in
#"Changed Type1"
And you will see:
Check my .pbix file attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
@dolevh
Do you need it as Power Query or DAX solution?
paste your sample data and the expected result from Excel in your reply
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
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 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 5 |