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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MichaelK27
New Member

Power Query sum with exceptions

Hi,

 

I have data in a row in this kind of format:

Name1, amount, name2, amount, name3, amount, name4, amount, name5, amount

 

Now I want to add a custom column where the output is the sum of the totale amount in the row. BUT if any of the names is e.g. School, I don't want to add this to my sum. However, in every row it can be in another place.

 

Is there a solution for this?

3 REPLIES 3
Anonymous
Not applicable

Hi @MichaelK27 ,

 

It is recommended that you duplicate them, get each separate name and amount column, and append them together.

Append queries - Power Query | Microsoft Learn

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

MichaelK27
New Member

Hi @Anonymous ,

 

I will have a static table with this information. And the total amount of columns used for this will be 9x the name (type of cost) and 9x the cost. Does this answer your question?

 

Anonymous
Not applicable

Hi @MichaelK27 

 

Will you have always these number of columns? Or the number of columns could be dinamic?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.