Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi Friends,
I need to have a cod for the belwo senario
In a sheet Colomn "A" has "Grade 1" and Column "B" has "USA" and Column"C" has "Apple" then rest of the rows where ever Column "B" has "USA" and column"C" has "Apple" colume "A" to be updated with "Grade1"
In a netshell if Column A has some string same to be repeated in the rest of the row in Colomn A where ever column B&C data's are matching.
Can we bring this in power query "M Code" ?
Regrds,
Prabhu
Solved! Go to Solution.
@prabhuk
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and check the steps. I attached the file below my signature.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci9KTElVMFTSUQoNdgSSjgEBPq5KsTowGWOgmLOjn6MLSNIJyPBzBMti0QAS8kYXwaXXG4tdRkAxb7Ch/kGOfu6ueCzCUIZwLaYbUPTHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column A" = _t, #"Column B" = _t, #"Column C" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column A", type text}, {"Column B", type text}, {"Column C", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Column A"}),
#"Added Custom" = Table.AddColumn(#"Replaced Value", "Grades", each Table.SelectRows(#"Replaced Value", (x)=> x[Column A]<>null and x[Column B] = [Column B] and x[Column C] = [Column C] )[Column A]{0})
in
#"Added Custom"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@prabhuk
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and check the steps. I attached the file below my signature.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci9KTElVMFTSUQoNdgSSjgEBPq5KsTowGWOgmLOjn6MLSNIJyPBzBMti0QAS8kYXwaXXG4tdRkAxb7Ch/kGOfu6ueCzCUIZwLaYbUPTHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column A" = _t, #"Column B" = _t, #"Column C" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column A", type text}, {"Column B", type text}, {"Column C", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Column A"}),
#"Added Custom" = Table.AddColumn(#"Replaced Value", "Grades", each Table.SelectRows(#"Replaced Value", (x)=> x[Column A]<>null and x[Column B] = [Column B] and x[Column C] = [Column C] )[Column A]{0})
in
#"Added Custom"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |