Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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!🙏

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

    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
    

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

    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
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks!!