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

Calculate Column base on result previous result row divide

Hello all,

 

I really need help please help.  I am new in Power BI,  I used to use other Bisnis Intelengence tool that is very easy to solve this type of problem. (only with click, in calculated table, compute using table cross and choose relative to previous value).

 

I have a table that I would like to achieve in Result column with calculation ( Values row B/  Values row A) * 100 and continue  ( Values row C/  Values row B) * 100 ..... etc :     

 

CategoryValue  Result 
A824---
B1711Values B/ Values A * 100              (1711/824)*100
C802Value C / Values B * 100              (802/1711)*100
D839Values D / Values C * 100           (839/802)*100
E471Values E / Value D * 100             (471/839)*100
F293Value F / Value E * 100               (293/471) * 100
G31Value G / Value  F * 100              ( 31/293)*100

 

Any solution to help my problem here? maybe using DAX function calculate? or Power Query?  or other way?

Any help would be much appreciated.

 

Thank you in advance

 

EH

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

You need to create an index column.

 

Column = if('Table'[index]=1,blank(),
'Table'[value]/MAXX(FILTER('Table','Table'[index]=EARLIER('Table'[index])-1),'Table'[value])*100)

1.PNG 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@Anonymous 

You need to create an index column.

 

Column = if('Table'[index]=1,blank(),
'Table'[value]/MAXX(FILTER('Table','Table'[index]=EARLIER('Table'[index])-1),'Table'[value])*100)

1.PNG 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hello,

 

I am really really new with the Dax and Power BI,  when I tried your formula,  it said "the syntax of the blank is in correct.   I attached the capture here.  Is it my syntax wrong.   Thank you in advance.  EH

 

blank1.JPG

 

 

 

 

Anonymous
Not applicable

thank you, I will try 

Anonymous
Not applicable

I solve my problem, it is matter ";"  and " , "   .  I should use  " ; " in If conditional statement   🙂   

amitchandak
Super User
Super User

@Anonymous , is there sequence or order of these categories. Because there is nothing like last row value. So we need get the values based on logic.

 

On way, I think of Rank. Just Like I have used for Week

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123

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.