Forum Discussion
Sadhikari
2 years agoFrequent Visitor
DAX Help - Measure based on different time slice
Hi All, Need some help with a calculation based on dataset below. Dataset tables Orders Order Date Order Hour Ship Date Ship Hour Model Relationship Orders[OrderDate] -...
- Anonymous1 year ago
Hi Sadhikari ,
Please try using the following DAX formula to create measures.
Orders Shipped = COUNTROWS('Orders') + 0Orders Placed = VAR _currentSHIPHOUR = MAX('Ship Hour'[Ship Hour]) VAR _vtable = SUMMARIZE(ALLSELECTED('Orders'),'Orders'[Order Hour],"_Count",COUNT(Orders[Order Hour])) RETURN IF(HASONEVALUE('Ship Hour'[Ship Hour]),SUMX(FILTER(_vtable,[Order Hour]=_currentSHIPHOUR),[_Count]),SUMX(_vtable,[_Count])) + 0Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sadhikari
1 year agoFrequent Visitor
Hi ,
thanks for the advise but somehow allexcept not giving desired results also this calculation not showing total value.
Anonymous
1 year agoNot applicable
Hi Sadhikari ,
Please try using the following DAX formula to create measures.
Orders Shipped = COUNTROWS('Orders') + 0Orders Placed =
VAR _currentSHIPHOUR = MAX('Ship Hour'[Ship Hour])
VAR _vtable = SUMMARIZE(ALLSELECTED('Orders'),'Orders'[Order Hour],"_Count",COUNT(Orders[Order Hour]))
RETURN
IF(HASONEVALUE('Ship Hour'[Ship Hour]),SUMX(FILTER(_vtable,[Order Hour]=_currentSHIPHOUR),[_Count]),SUMX(_vtable,[_Count])) + 0
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.