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
-_-
New Member

Read Cell Contents as Formula

I have cell contents that look like the following:

 

ItemQty
A2|1|1
B1|1|1|1
C0|1|1|1|1

 

I am trying to multiple the values together as if the "|" was a "*". Text to columns poses some issues as the number of "|" can be up to ~25 and there would need to be null value management.

 

Is there a way to do a 'find/ replace" for "|" to "*" and read the contents as a formula?

 

Open to ideas.... 

1 ACCEPTED SOLUTION
Jakinta
Solution Sage
Solution Sage

You can use List.Accumulate as below.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTKqMazRNVWK1YlWcoJyjQxrDMECzkABA6AAGCrFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Qty = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Accumulate( List.Transform(Text.Split([Qty],"|"), Number.From) ,1,(s,c)=> s*c), type number)
in
    #"Added Custom"

 

Result

Jakinta_1-1634062414202.png

 

 

View solution in original post

2 REPLIES 2
Jakinta
Solution Sage
Solution Sage

You can use List.Accumulate as below.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTKqMazRNVWK1YlWcoJyjQxrDMECzkABA6AAGCrFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Qty = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Accumulate( List.Transform(Text.Split([Qty],"|"), Number.From) ,1,(s,c)=> s*c), type number)
in
    #"Added Custom"

 

Result

Jakinta_1-1634062414202.png

 

 

This worked perfectly! Thank you!

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors