cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Amir851
Helper I
Helper I

Display Current row value in another row in different column

Dear All,

 

I am a bit new to Dax, I have a requirement to display the current row value(Sum of Duration) in the next row of another column(Sum of Duration1).

 

Description is a column of Table

Sum of Duration is a Measure

Rank_Measure is a measure

Rank Next is a Measure

Sum of Duration1 is a measure that I am trying to create.

 

Description(Column-Part of Table)Sum of Duration(Measure)Rank_Measures(Measure)Rank Next(Measure)Sum of Duration1(Measure)
Component110,9467 
Component29,007810,94
Component38,00899,00
Component47,009108,00
Component56,6010117,00
Component65,4011126,60
Component73,2012135,40

 Can some one please advise me on this.

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Amir851 ,

 

You may remain your [Rank_Measure], try to create another Rank column, then create measure [Sum of Duration1] as follows:

 

Column: Rank = RANKX(ALL(Table1),[Sum of Duration],,DESC, Dense)
 
Measure: Sum of Duration1 = CALCULATE(Table1[Sum of Duration]),FILTER(ALLSELECTED(Table1), Table1[Rank] =MAX(Table1[Rank])-1))

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @Amir851 ,

 

You may remain your [Rank_Measure], try to create another Rank column, then create measure [Sum of Duration1] as follows:

 

Column: Rank = RANKX(ALL(Table1),[Sum of Duration],,DESC, Dense)
 
Measure: Sum of Duration1 = CALCULATE(Table1[Sum of Duration]),FILTER(ALLSELECTED(Table1), Table1[Rank] =MAX(Table1[Rank])-1))

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-xicai
Community Support
Community Support

Hi @Amir851 ,

 

You can create measure like DAX below.

 

Sum of Duration1 = CALCULATE(Table1[Sum of Duration]),FILTER(ALLSELECTED(Table1), Table1[Rank_Measure] =Table1[Rank_Measure]-1))

 

Or you may add Index column to original table in Query Editor.

Index_add.png

 

 

 

 

 

Then create measure like DAX below.

 

Sum of Duration1 = CALCULATE(Table1[Sum of Duration]),FILTER(ALLSELECTED(Table1), Table1[Index] =MAX(Table1[Index])-1))

 

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear @v-xicai ,

 

Thank you for your response,

 

I have tried that Dax which you mentioned earlier itself but it was not working and it returned empty value, The issue is that I cannot create an index column in this situation because Rank_Measure is a measure and it has four slicer acting upon it.is there is any other way to do it.

 

Thanks

Amir

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors