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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Calculated column (DAX) with next consecutive value

Hi everyone,

 

I need help with what I think could be a fairly simple issue, but I'm still a newbie and really can't get it to work.

 

I would like to create a calculated column (with DAX) to find, for every instance in my table, its next consecutive value.

 

The "Goal" column should be the output:

 

OccurrenceValueGoal
AAAA13
AAAA34
AAAA410
AAAA10 
BBBB12
BBBB28
BBBB811
BBBB11 

 

I really tried looking for the same issue, but nothing seems to fit.

 

Thanks a lot to whoever will help!🙏

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

Slide1.jpg

 

Goal CC =
VAR currentoccurrence = Data[Occurrence]
VAR currentvalue = Data[Value]
VAR newtable =
    FILTER (
        Data,
        Data[Occurrence] = currentoccurrence
            && Data[Value] > currentvalue
    )
VAR goalvalue =
    MINX ( newtable, Data[Value] )
RETURN
    goalvalue

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

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

Slide1.jpg

 

Goal CC =
VAR currentoccurrence = Data[Occurrence]
VAR currentvalue = Data[Value]
VAR newtable =
    FILTER (
        Data,
        Data[Occurrence] = currentoccurrence
            && Data[Value] > currentvalue
    )
VAR goalvalue =
    MINX ( newtable, Data[Value] )
RETURN
    goalvalue

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

Anonymous
Not applicable

Thanks!! 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.