cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aliraza New Member
New Member

How to add multiple "calculated columns" in Power Query?

For Example, I want to add 2 columns using power Query by making a measure of subtraction on 4 columns from my CCL table. Let I have these 4 columns:

MAT Value 19        MAT Value 18           MTH 19        MTH 18

I want to calculate:

MAT Diff= [MAT Value 19] - [MAT Value 18]

MTH Diff= [MTH 19] - [MTH 18]

i.e, I want to use the following query for multiple subtractions.

= Table.AddColumn(#"Changed Type1", "Subtraction", each [MAT_VALUE_19] - [MAT_VALUE_18], type number)

1 REPLY 1
Super User
Super User

Re: How to add multiple "calculated columns" in Power Query?

Hi @aliraza,

this blog post could help you to automate your solution: https://community.powerbi.com/t5/Community-Blog/Solving-Real-Life-Problems-with-Recursive-Functions-....

But I think it'll be simpler to click some queries in the UI of the PowerQuery Editor, if you have only few columns in one table.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 343 members 3,518 guests
Please welcome our newest community members: