Forum Discussion
How to Automatically Move Unfinished Projects to the Next Month in Power BI
- Anonymous1 year ago
Hi amaral_diego ,
I update the measure, you can try this one.
AjustarData = VAR _Today = TODAY () VAR _DATEDIFF = DATEDIFF ( 'Table'[Termino], TODAY (), DAY ) VAR _DATE1 = EOMONTH ( TODAY (), -1 ) + DAY ( 'Table'[Termino] ) VAR _DATE2 = EOMONTH ( _DATE1, 0 ) + DAY ( 'Table'[Termino] ) RETURN IF ( 'Table'[Status] = "Complete", 'Table'[Termino], IF ( 'Table'[Termino] < _Today, IF ( _DATE1 < TODAY (), _DATE2, _DATE1 ), 'Table'[Termino] ) )Result of my sample is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, with this code is almost helped me, it worked to send all projects to the next moth, but, for example, now I've 6 projects delayed from september that is now send to october, although I've one deleyed in october and he still in octorber, is possible to sent him do november?
If not, it's ok, I'll acept thi one as solution, thanks a lot.
Hi amaral_diego ,
I update the measure, you can try this one.
AjustarData =
VAR _Today =
TODAY ()
VAR _DATEDIFF =
DATEDIFF ( 'Table'[Termino], TODAY (), DAY )
VAR _DATE1 =
EOMONTH ( TODAY (), -1 ) + DAY ( 'Table'[Termino] )
VAR _DATE2 =
EOMONTH ( _DATE1, 0 ) + DAY ( 'Table'[Termino] )
RETURN
IF (
'Table'[Status] = "Complete",
'Table'[Termino],
IF (
'Table'[Termino] < _Today,
IF ( _DATE1 < TODAY (), _DATE2, _DATE1 ),
'Table'[Termino]
)
)
Result of my sample is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amaral_diego1 year agoHelper II
It worked, thanks a lot!