Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Use Measure with previous workday

I have a simple measure: Orders released not shipped = CALCULATE( COUNT(CD_OTTC_SHIPPING_LINE[KeyID]); CD_OTTC_SHIPPING[ISBLANK_DISPATCH_DATE] = TRUE ) I need this KPI for each day and the p...
  • Anonymous's avatar
    Anonymous
    7 years ago

    I played around a little bit with your code and came up with this solution. Seems to work now.

    Test previous wd = 
    VAR currDate =
        MAX (DimDate[Date])
    VAR prev =
        MAX(Workdays[previous workday])
        
    RETURN
        CALCULATE (
            [Orders released not shipped];
            FILTER(ALLSELECTED(CD_OTTC_SHIPPING_LINE); CD_OTTC_SHIPPING_LINE[date.OLLASTUPDDTE] = prev )
        )