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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AJPF
Helper I
Helper I

expression.error when trying to add up numerics in Power Query

I have a variable called "Start" which I am trying to sum down the entire column.   It contains only 0 or 1 and it's formatted as a whole number. 

In Power Query I have: 

= Table.AddColumn(#"PREVIOUS STEP", "Start Total", each List.Sum([Start]))

but I keep getting the message: 

"Expression.Error: We cannot convert the value 1 to type List.
Details:
Value=1
Type=[Type]"

Why can I not add numeric values? 

Is there another way of doing this?  I don't care whether I do it in Power Query or as a new measure. 

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @AJPF 

 

you get this error because List.Sum is expecting a list, but you are feeding the function a number. I don't know whats the goal you are trying to achieve. I suppose you would like to sum the whole column start. This however would result in the same number in every row, as you are not filter the column before. If this is it what you would like to achive use this formula

= Table.AddColumn(#"PREVIOUS STEP", "Start Total", each List.Sum(#"PREVIOUS STEP"[Start]))

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

1 REPLY 1
Jimmy801
Community Champion
Community Champion

Hello @AJPF 

 

you get this error because List.Sum is expecting a list, but you are feeding the function a number. I don't know whats the goal you are trying to achieve. I suppose you would like to sum the whole column start. This however would result in the same number in every row, as you are not filter the column before. If this is it what you would like to achive use this formula

= Table.AddColumn(#"PREVIOUS STEP", "Start Total", each List.Sum(#"PREVIOUS STEP"[Start]))

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors