Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello All,
I have got a question and de "googled solutions didn't work for me yet.
So I've got a linegraph showing a typcial early and late curve.
The "Actual line" is shown as a third line, shown in green.
Now I would realy like the green line to stop repeating the highest value, however I havent found a working solution yet.
the Code behind the green line is as followes:
Can anybody help me in the right direction?
Thanks!
Solved! Go to Solution.
Hello @JohannesE
I would suggest following the approach from DAX Patterns:
https://www.daxpatterns.com/cumulative-total/#highlighter_923147
I'm assuming Datelist is market as a date table with Datelist[Date] being the date column.
Here is how I would rewrite your measure, adjusting slightly to use the DAX Patterns pattern, using <= rather than avoiding ISONORAFTER:
S-curve_Actual_IFR =
VAR LastVisibleDate =
MAX ( Datelist[Date] )
VAR FirstVisibleDate =
MIN ( Datelist[Date] )
VAR LastDateWithData =
CALCULATE ( MAX ( IFR_P6[Actual Finish] ), REMOVEFILTERS () )
RETURN
IF (
FirstVisibleDate <= LastDateWithData,
CALCULATE (
COUNTA ( 'IFR_P6'[Actual Finish] ),
USERELATIONSHIP ( IFR_P6[Actual Finish], Datelist[Date] ),
ALLSELECTED ( 'Datelist'[Date] ),
Datelist[Date] <= LastVisibleDate
)
)
This should return this same results as before but with the line ending at the last date with data.
It's possible you might need to tweak LastDateWithData.
Does this work for you?
Regards,
Hello @JohannesE
I would suggest following the approach from DAX Patterns:
https://www.daxpatterns.com/cumulative-total/#highlighter_923147
I'm assuming Datelist is market as a date table with Datelist[Date] being the date column.
Here is how I would rewrite your measure, adjusting slightly to use the DAX Patterns pattern, using <= rather than avoiding ISONORAFTER:
S-curve_Actual_IFR =
VAR LastVisibleDate =
MAX ( Datelist[Date] )
VAR FirstVisibleDate =
MIN ( Datelist[Date] )
VAR LastDateWithData =
CALCULATE ( MAX ( IFR_P6[Actual Finish] ), REMOVEFILTERS () )
RETURN
IF (
FirstVisibleDate <= LastDateWithData,
CALCULATE (
COUNTA ( 'IFR_P6'[Actual Finish] ),
USERELATIONSHIP ( IFR_P6[Actual Finish], Datelist[Date] ),
ALLSELECTED ( 'Datelist'[Date] ),
Datelist[Date] <= LastVisibleDate
)
)
This should return this same results as before but with the line ending at the last date with data.
It's possible you might need to tweak LastDateWithData.
Does this work for you?
Regards,
Hey owen,
That works like a charm!
Thanks for your help, now I need to slowly comprihand the applied logic 🙂
Kind Regards
Hans
User | Count |
---|---|
59 | |
22 | |
18 | |
18 | |
16 |
User | Count |
---|---|
85 | |
54 | |
45 | |
39 | |
21 |