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

Join 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.

Reply
mindfulmike
Frequent Visitor

How to find a single cell in a column with an if then divide it by 5 without making a new column

Hi all, 

 

I have 2 columns, Clients and their Totals. One client needs to have their total divided by 5. 

 

I made a conditonal column that works, formula: = Table.AddColumn(#"Added Custom", "Custom", each if [Client] = "ABC" then [Total]/5 else [Total])

 

Althouugh this works, is there a way to select the Total column and do this without creating a new column?

 

As far as I know the this cannot be done under Transform, Standard operations because I cannot us an each if expression. 

 

Thanks!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mindfulmike ,

 

Please try:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0VIrVATKdgGwjIyjbGcgxNlaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Clients = _t, Totals = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Clients", type text}, {"Totals", Int64.Type}}),
    Custom1 = Table.FromColumns({Table.ToColumns(#"Changed Type"){0}} & {List.Transform(Table.ToRows(#"Changed Type"), each if _{0}="ABC" then _{1}/5 else _{1})},{"Clients","Totals"})
in
    Custom1

vcgaomsft_0-1675825977520.png

vcgaomsft_1-1675825990124.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
wdx223_Daniel
Super User
Super User

=Table.ReplaceValue(PreviousStepName,each [Client],5,(x,y,z)=>if y="ABC" then x/z else x,{"Total"})

Anonymous
Not applicable

Hi @mindfulmike ,

 

Please try:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0VIrVATKdgGwjIyjbGcgxNlaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Clients = _t, Totals = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Clients", type text}, {"Totals", Int64.Type}}),
    Custom1 = Table.FromColumns({Table.ToColumns(#"Changed Type"){0}} & {List.Transform(Table.ToRows(#"Changed Type"), each if _{0}="ABC" then _{1}/5 else _{1})},{"Clients","Totals"})
in
    Custom1

vcgaomsft_0-1675825977520.png

vcgaomsft_1-1675825990124.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

smpa01
Super User
Super User

@mindfulmike 

Table.SelectRows(prevStep, each ([Column1]/5 = 1))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Kudoed Authors