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
powerbisach
Helper I
Helper I

Apply similar formula to all rows of a calculated colum

Hi ,

 

I have this requirement where i have one column from which i need to get the Diff_amount and %Change

Column Calculation.png

The column Diff_amount and % change contains large rows, so i need to replicate the same formula for this column.

With excel i can easily perform a drag and drop operation. How this can be performed in powerbi adding a calculated columns.

1 ACCEPTED SOLUTION

@powerbisach

 

In Power BI, rows in table has no sequence internal. So if you want to handle some "previous/next" scenario on row level, you must create an index column in your table. You can do it in Query Editor. Then you can create your calculated column based on this index column easily.

 

44.PNG

 

Regards,

View solution in original post

3 REPLIES 3
powerbisach
Helper I
Helper I

Hi,

 

Unfortunately your solution did not worked. Any other idea?

@powerbisach

 

In Power BI, rows in table has no sequence internal. So if you want to handle some "previous/next" scenario on row level, you must create an index column in your table. You can do it in Query Editor. Then you can create your calculated column based on this index column easily.

 

44.PNG

 

Regards,

TomMartens
Super User
Super User

Hey, 

 

first create a calculated column using the LOOKUP() function

LOOKUPVALE('yourtable'[Amount], 'yourtable'[Year],'yourtable'[Year]-1) - 'yourtable'[Amount] for DiffColumn (or the other way round)

 

then, just create a calculated column using both columns

 

Hope this helps

Regards

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.