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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-stephen-msft
Community Support
Community Support

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 @Luis98 ,

 

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?

 

Luis98
Resolver II
Resolver II

Hi @MichaelK27 

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors