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
Anonymous
Not applicable

Calculation for every row

Hi all,

 

I had a question regarding making a calculation that has to be performed on every record in a column.

My data looks like this

X
7
29
7
82
118

Now what I want is for every row to be substracted by 5. With outcome like:

X
2
24
2
77
113

Is it best to do this through a calculated column ?

 

Thanks in advance,

L.Meijdam

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

It depends.

 

If you want to keep the original values, you can either add a custom column in Power Query or a calculated column in DAX.

 

If you want to transform the values, you can use Power Query: Edit Queries - Transform - Standard - Subtract - 5.

 

 

Specializing in Power Query Formula Language (M)

View solution in original post

2 REPLIES 2
MarcelBeug
Community Champion
Community Champion

It depends.

 

If you want to keep the original values, you can either add a custom column in Power Query or a calculated column in DAX.

 

If you want to transform the values, you can use Power Query: Edit Queries - Transform - Standard - Subtract - 5.

 

 

Specializing in Power Query Formula Language (M)
Anonymous
Not applicable

Hi @MarcelBeug,

 

Since I prefered a DAX solution here I created a calculated column to achieve it. Thanks for sharing your insights with me.

 

Regards,

L.Meijdam

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.