Forum Discussion
CBrinky
2 years agoFrequent Visitor
Creating a "Current Activity Flag" based on different scenarios.
Hi all, I've done my best to research this, using forums, google, chatgpt to create a solution. I just can't get my head around this. I have 3 different project scenarios where you can see wha...
- Anonymous2 years ago
Hi CBrinky ,
You can use this DAX:Measure 2 = var _countend=COUNTX(ALLSELECTED('Table'),'Table'[ACT_END_DATE]) var _countname=COUNTX(ALLSELECTED('Table'),'Table'[TASK_NAME]) var _maxend=MAXX(ALL('Table'),'Table'[ACT_END_DATE]) var _maxid= CONCATENATEX( FILTER(ALL('Table'),'Table'[ACT_END_DATE]=_maxend),[TASK_ID],"-") return IF( _countend=_countname,"Job complete", IF( CONTAINSSTRING( _maxid,MAX('Table'[TASK PREDECESSOR]))=TRUE()&&MAX('Table'[TASK PREDECESSOR])<>BLANK(), "current activity", BLANK()))I didn't use "switch", but it work in my situation.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CBrinky
2 years agoFrequent Visitor
Hi Dino,
Is there a way to maybe use the "switch" function to combine these solutions? So it'd check if it means 1 condition, and if it doesn't it checks if it meets the next condition? Your help is greatly appreciated!
Anonymous
2 years agoNot applicable
Hi CBrinky ,
You can use this DAX:
Measure 2 =
var _countend=COUNTX(ALLSELECTED('Table'),'Table'[ACT_END_DATE])
var _countname=COUNTX(ALLSELECTED('Table'),'Table'[TASK_NAME])
var _maxend=MAXX(ALL('Table'),'Table'[ACT_END_DATE])
var _maxid=
CONCATENATEX(
FILTER(ALL('Table'),'Table'[ACT_END_DATE]=_maxend),[TASK_ID],"-")
return
IF(
_countend=_countname,"Job complete",
IF(
CONTAINSSTRING(
_maxid,MAX('Table'[TASK PREDECESSOR]))=TRUE()&&MAX('Table'[TASK PREDECESSOR])<>BLANK(),
"current activity", BLANK()))
I didn't use "switch", but it work in my situation.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.