Forum Discussion

KG1's avatar
KG1
Resolver I
3 years ago
Solved

Measure Interpretation

Hi   I am working on a dashboard that has been developed by someone else   I am struggling to breakdown this measure and what it is actually doing   = CALCULATE(COUNTA('Export'[Order]),DATESBE...
  • johnt75's avatar
    johnt75
    3 years ago

    Its easier to read if its properly formatted

    CALCULATE (
        COUNTA ( 'Export'[Order] ),
        DATESBETWEEN (
            'Export'[Actual_Finish_date],
            MAX ( 'Export'[Actual_Finish_date] )
                - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 ),
            MAX ( 'Export'[Actual_Finish_date] )
        )
    )

    So 

    MAX ( 'Export'[Actual_Finish_date] )
         - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 )

    gives the Monday of the relevant date. Using that as a parameter to DATESBETWEEN it is counting the number of orders within that week.