Forum Discussion
Track reversed orders from timestamp data
- 5 years ago
Hi digitalpresto ,
Try the following formula:
Measure = var t = MAX('Table'[Status Appr Date]) return CALCULATE( DISTINCTCOUNT('Table'[ID]), FILTER( 'Table', 'Table'[Status Appr Date] <> BLANK() && ( 'Table'[Status New Date] > t || 'Table'[Status Wvalid Date] > t || 'Table'[Status Valid Date] > t || 'Table'[Status Wappr Date] > t ) ) )Measure 2 = IF( ISFILTERED('Table'[ID]), [Measure], SUMX( ALLSELECTED('Table'[ID]), [Measure] ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi digitalpresto ,
Try the following formula:
Measure =
var t = MAX('Table'[Status Appr Date])
return
CALCULATE(
DISTINCTCOUNT('Table'[ID]),
FILTER(
'Table',
'Table'[Status Appr Date] <> BLANK()
&& (
'Table'[Status New Date] > t
|| 'Table'[Status Wvalid Date] > t
|| 'Table'[Status Valid Date] > t
|| 'Table'[Status Wappr Date] > t
)
)
)Measure 2 =
IF(
ISFILTERED('Table'[ID]),
[Measure],
SUMX(
ALLSELECTED('Table'[ID]),
[Measure]
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- digitalpresto5 years agoFrequent Visitor
Thanks v-kkf-msft , yes that marks the Reversed orders correctly, buy since the table can have many rows per order, should we put it to a Summary table (using the SUMMARIZE function), also how do we get the latest/current order status per order?
- v-kkf-msft5 years agoCommunity Support
Hi digitalpresto ,
Try the following formula:
Status = var Tab = FILTER( UNION( SELECTCOLUMNS('Table', "ID", [ID], "Date", [Status New Date], "Status", "New"), SELECTCOLUMNS('Table', "ID", [ID], "Date", [Status Wvalid Date], "Status", "Wvalid"), SELECTCOLUMNS('Table', "ID", [ID], "Date", [Status Valid Date], "Status", "Valid"), SELECTCOLUMNS('Table', "ID", [ID], "Date", [Status Wappr Date], "Status", "Wappr"), SELECTCOLUMNS('Table', "ID", [ID], "Date", [Status Appr Date], "Status", "Appr") ), [Date] <> BLANK() ) var M_Date = MAXX(Tab, [Date]) return MAXX( FILTER(Tab, [Date] = M_Date), [Status] )Best Regards,
Winniz