cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Microsoft
Microsoft

Re: Apply similar formula to all rows of a calculated colum

@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
Super User III
Super User III

Re: Apply similar formula to all rows of a calculated colum

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

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!
powerbisach Helper I
Helper I

Re: Apply similar formula to all rows of a calculated colum

Hi,

 

Unfortunately your solution did not worked. Any other idea?

Microsoft
Microsoft

Re: Apply similar formula to all rows of a calculated colum

@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

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors