Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Add column based on organization name

Dear Community,

 

I have an Excel file with with 2 organization names in one column. Need to add column so it puts Org bane against its account.

Account-OrgAmountOrganization (need to add this coulumn)
XXXXX LLC                              -  XXXXX LLC
1022                              -  XXXXX LLC
1030              65,979,610XXXXX LLC
1210           266,002,627XXXXX LLC
1254                   407,468XXXXX LLC
1421                   273,321XXXXX LLC
YYYYY LLC                              -  YYYYY LLC
1022                              -  YYYYY LLC
1030           386,301,847YYYYY LLC
1210        1,426,782,560YYYYY LLC
1251              (1,660,057)YYYYY LLC
1254                              -  YYYYY LLC
7480                              -  YYYYY LLC
7710                              -  YYYYY LLC
   
   
   

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try yjis code in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("1ZJBDsJACEWvQmalyTcBhoHp2m0PoGl6N8/iyXRSXXZsjRshYcX7gQ/TlC4taBzPCel++zbp1GqaMSVh1d9pZe5qkRcMMcCFF0BlDSB1B7PCNV69xTYOSsYB87pwprKV08jIz/bGXVv8odOUqyOzoFqsm0wCU0dURfH3MUrfKDoI3Blc4rj3JB83Cqv939mjFatvtU9rfgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account-Org" = _t, Amount = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Account-Org", type text}, {"Amount", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if (try Number.From( [#"Account-Org"]) otherwise "i")="i" then [#"Account-Org"] else null),
    #"Filled Down" = Table.FillDown(#"Added Custom",{"Custom"})
in
    #"Filled Down"

View solution in original post

2 REPLIES 2
dharmendars007
Super User
Super User

Hello @Anonymous , 

Thank you for your question..

Please use the below condition in Power query to get the desired result..

dharmendars007_0-1724490136597.png


let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Org Column", each if
Value.Is([#"Account-Org"],type text) then [#"Account-Org"] else null),
#"Filled Down" = Table.FillDown(#"Added Custom",{"Org Column"}),
#"Changed Type" = Table.TransformColumnTypes(#"Filled Down",{{"Account-Org", type any}, {"Amount", type text}, {"Org Column", type text}})
in
#"Changed Type"

If you find this helpful , please mark it as solution and remember to give kudos
  

Thank You

Dharmendar S

LinkedIN 

 

Ahmedx
Super User
Super User

pls try yjis code in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("1ZJBDsJACEWvQmalyTcBhoHp2m0PoGl6N8/iyXRSXXZsjRshYcX7gQ/TlC4taBzPCel++zbp1GqaMSVh1d9pZe5qkRcMMcCFF0BlDSB1B7PCNV69xTYOSsYB87pwprKV08jIz/bGXVv8odOUqyOzoFqsm0wCU0dURfH3MUrfKDoI3Blc4rj3JB83Cqv939mjFatvtU9rfgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account-Org" = _t, Amount = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Account-Org", type text}, {"Amount", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if (try Number.From( [#"Account-Org"]) otherwise "i")="i" then [#"Account-Org"] else null),
    #"Filled Down" = Table.FillDown(#"Added Custom",{"Custom"})
in
    #"Filled Down"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.