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
aliraza
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
Nolock
Resident Rockstar
Resident Rockstar

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