Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have the below code who shows in column the results based on the following logic:
This works perfectly with the below code, only when it is the first row (based on the session id) it remains empty because the code can not find a previous result (which makes sense). What I kind of need to do is add a condition to check if the current row is the first row and if so, then show the 'test result'. I'm only not sure how to do this, so hopefully someone can give me some guidance on how to achieve this. Thanks!!
Column =
var _previosid=MAXX(filter('Table','Table'[session]=EARLIER('Table'[session])&& 'Table'[ID]< EARLIER('Table'[ID])),'Table'[ID])
var _review=CALCULATE(MAX('Table'[Review]),FILTER('Table','Table'[ID]=_previosid))
return
SWITCH(TRUE(),'Table'[Test]="Effective" && 'Table'[Review]="Effective","Effective",
'Table'[Test]="Effective" && 'Table'[Review]="Ineffective","Ineffective",
'Table'[Test]="Effective" && 'Table'[Review]="Open",_review)
Solved! Go to Solution.
maybe you can try this
Column =
var _previosid=MAXX(filter('Table','Table'[session]=EARLIER('Table'[session])&& 'Table'[ID]< EARLIER('Table'[ID])),'Table'[ID])
var _review=CALCULATE(MAX('Table'[Review]),FILTER('Table','Table'[ID]=_previosid))
VAR _result=
SWITCH(TRUE(),'Table'[Test]="Effective" && 'Table'[Review]="Effective","Effective",
'Table'[Test]="Effective" && 'Table'[Review]="Ineffective","Ineffective",
'Table'[Test]="Effective" && 'Table'[Review]="Open",_review)
return if (_result="","test result",_result)
Proud to be a Super User!
you are welcome
Proud to be a Super User!
maybe you can try this
Column =
var _previosid=MAXX(filter('Table','Table'[session]=EARLIER('Table'[session])&& 'Table'[ID]< EARLIER('Table'[ID])),'Table'[ID])
var _review=CALCULATE(MAX('Table'[Review]),FILTER('Table','Table'[ID]=_previosid))
VAR _result=
SWITCH(TRUE(),'Table'[Test]="Effective" && 'Table'[Review]="Effective","Effective",
'Table'[Test]="Effective" && 'Table'[Review]="Ineffective","Ineffective",
'Table'[Test]="Effective" && 'Table'[Review]="Open",_review)
return if (_result="","test result",_result)
Proud to be a Super User!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
108 | |
107 | |
93 | |
70 |
User | Count |
---|---|
173 | |
135 | |
131 | |
96 | |
94 |