Forum Discussion
Anonymous
4 years agoNot 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:
| Occurrence | Value | Goal |
| AAAA | 1 | 3 |
| AAAA | 3 | 4 |
| AAAA | 4 | 10 |
| AAAA | 10 | |
| BBBB | 1 | 2 |
| BBBB | 2 | 8 |
| BBBB | 8 | 11 |
| BBBB | 11 |
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
- Jihwan_KimSuper User
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- AnonymousNot applicable
Thanks!!