March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 what the "current activity" is. Based on predecessors, dates, task_id, project id etc.
It works with the below example as it only has 1 "predecessor" with start/finish date
I don't know how to adjust it so in this scenario it only shows "Surface Treatment" as the current activity.
And I don't know how to adjust it so in this scenario it just displays as "Job complete"
Successor =
Solved! Go to Solution.
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.
Hi @CBrinky ,
Please try this way:
Use this DAX to create a new measure:
Successor =
VAR _MAXEND = MAXX(ALL('Table'), 'Table'[ACT_END_DATE])
VAR _MAXID = MAXX(FILTER(ALL('Table'), 'Table'[ACT_END_DATE] = _MAXEND), [TASK_ID])
RETURN
IF(
MAX('Table'[TASK PREDECESSOR]) = _MAXID, "current activity", BLANK())
And about "Job complete", you can use these DAXs:
Successor1 =
IF(
CALCULATE(
COUNTROWS('Table2'),
NOT(ISBLANK('Table2'[ACT_END_DATE]))
) = COUNTROWS('Table2'),
"Job complete"
)
Or
Successor2 =
IF(
COUNTBLANK(Table2[ACT_END_DATE]) > 0,
"non-complete",
"Job complete"
)
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.
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!
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |