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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hey!
I am trying to make a new Column (NewColumn) or Measure, where it uses the state of the row before, for example:
Time Duration(s) State NewColumn (ActualState) Index
2014 150 Operational Operational 1'
2014 150 Operational Operational 2
2014 150 Operational Operational 3
2014 150 Operational Operational 4
2014 1 Indeterminate Operational 5
2014 150 Operational Operational 6
2014 150 Operational Operational 7
For example I want and IF Function, if the duration of tim is less then 4 seconds then use the State of Previous Index, so I want a new Column called ActualState as can be seen. I have tried many different DAX functions but cant make anybody work.
Here are some thoughts: (havent made anything work)
ActualState =
var CurrentIndex = Utilizations[Index2] -1
VAR UtilizationsState2 = Utilizations[State] of the index "CurrentIndex"??
return
IF(Utilizations[Duration_s]>4,Utilizations[State],
IF(Utilizations[Duration_s]<=4, UtilizationsState2 ))
ActualState =
var CurrentIndex= MAX(Utilizations[Index2])
var UtilizationsState2 =Utilizations[State] in CurrentIndex-1
return
IF(Utilizations[Duration_s]>4,Utilizations[State],
IF(Utilizations[Duration_s]<=4, UtilizationsState2))
ActualState2 =
FILTER(Utilizations,EARLIER((Utilizations[Index2]-1)))
Helpful for help,
Kind regards
Solved! Go to Solution.
@Anonymous Please try this as a "New Column"
NewState = VAR _PrevVal = LOOKUPVALUE(Test65PrevRow[State],Test61AbNormalDiff[Index],Test65PrevRow[Index]-1) RETURN IF(Test65PrevRow[Duration]<4,_PrevVal,Test65PrevRow[State])
Proud to be a PBI Community Champion
@Anonymous Please try this as a "New Column"
NewState = VAR _PrevVal = LOOKUPVALUE(Test65PrevRow[State],Test61AbNormalDiff[Index],Test65PrevRow[Index]-1) RETURN IF(Test65PrevRow[Duration]<4,_PrevVal,Test65PrevRow[State])
Proud to be a PBI Community Champion