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