Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Create a column based on index value in another column

l have a table which contains 2 columns: number and  order. l need a column "next_number" . l want to have the value of next row of the column number sort  by order. when the next number is null, we take the next number not null. 

NumberorderNext_number
1,3212,3
2,320.9
0,930,5
040,5
050,5
0,5669
697 

 

Please l need help.

 

1 ACCEPTED SOLUTION

Hi,

Thank you for your feedback, and sorry that I missed your requirement.

Could you please check if the below and the attached pibx file are providing a correct result? 

 

 

 

Next number CC =
VAR nextorder =
    MINX (
        FILTER ( Data, Data[order] > EARLIER ( Data[order] ) && Data[Number] <> 0 ),
        Data[order]
    )
RETURN
    MAXX ( FILTER ( Data, Data[order] = nextorder ), Data[Number] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

it gives the value of next row.  but when the next value of number is "0" it is supposed to skip it bcause it is null and use the next value of number not null.

Hi,

Thank you for your feedback, and sorry that I missed your requirement.

Could you please check if the below and the attached pibx file are providing a correct result? 

 

 

 

Next number CC =
VAR nextorder =
    MINX (
        FILTER ( Data, Data[order] > EARLIER ( Data[order] ) && Data[Number] <> 0 ),
        Data[order]
    )
RETURN
    MAXX ( FILTER ( Data, Data[order] = nextorder ), Data[Number] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thank you very much @Jihwan_Kim 😁. It works.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Untitled.png

 

Next number CC =
VAR nextorder =
    MINX ( FILTER ( Data, Data[order] > EARLIER ( Data[order] ) ), Data[order] )
RETURN
    MAXX ( FILTER ( Data, Data[order] = nextorder ), Data[Number] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.