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
monojchakrab
Resolver III
Resolver III

sum only numeric strings in a list containing both numeric and text strings

I am working with a list as follows :

{"x", "100","200")

And I want to sum only the 100 and 200, skipping the text string [the text string is not at a fixed loaction in all the lists, so list.skip does not work).

Is there some combination of List.Sum and List.Transform to acheive this task?

Thanking in advance

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

See here

List.Sum(List.Transform({"x", "100","200", "x300", 500}, (x)=> if Value.FromText(x) is number then Value.FromText(x) else 0 ))

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

See here

List.Sum(List.Transform({"x", "100","200", "x300", 500}, (x)=> if Value.FromText(x) is number then Value.FromText(x) else 0 ))

Thanks @Vijay_A_Verma - that worked like a charm. I was missing using the function, which simplifies the code.

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