Forum Discussion
Conditional Result based on Dates
- Anonymous2 years ago
Hi, GMadd
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:
Status1 = VAR _getCreateDate = SELECTEDVALUE ( 'Table'[Created On] ) VAR _getPlanedDate = SELECTEDVALUE ( 'Table'[Planned Goods Issue] ) VAR _getShippedDate = SELECTEDVALUE ( 'Table'[Shipped Date] ) RETURN SWITCH ( TRUE (), _getShippedDate - 2 >= _getPlanedDate && _getShippedDate - 2 >= _getCreateDate, "Late", _getShippedDate >= _getPlanedDate + 1 || _getShippedDate = _getCreateDate + 1, "Backorder", _getShippedDate = _getCreateDate, "On-time", "CheckData" )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, GMadd
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:
Status1 =
VAR _getCreateDate =
SELECTEDVALUE ( 'Table'[Created On] )
VAR _getPlanedDate =
SELECTEDVALUE ( 'Table'[Planned Goods Issue] )
VAR _getShippedDate =
SELECTEDVALUE ( 'Table'[Shipped Date] )
RETURN
SWITCH (
TRUE (),
_getShippedDate - 2 >= _getPlanedDate
&& _getShippedDate - 2 >= _getCreateDate, "Late",
_getShippedDate >= _getPlanedDate + 1
|| _getShippedDate = _getCreateDate + 1, "Backorder",
_getShippedDate = _getCreateDate, "On-time",
"CheckData"
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum