Forum Discussion

KeithC's avatar
KeithC
Frequent Visitor
3 years ago
Solved

Return value associated with latest date

Hi All   I am still relatively new in my DAX journey and looking for some assitance. I have a snippet of a table below and I have tried to create a calculated measure that   1. sum of the count  ...
  • johnt75's avatar
    johnt75
    3 years ago

    This will ignore any filters from anywhere

    Prev CMI Count =
    VAR MaxDate =
        CALCULATE ( MAX ( 'Table'[Date] ), REMOVEFILTERS () )
    VAR PrevDate =
        CALCULATE ( MAX ( 'Table'[Date] ), 'Table'[Date] < MaxDate, REMOVEFILTERS () )
    VAR Result =
        CALCULATE ( [Count total], REMOVEFILTERS (), 'Table'[Date] = PrevDate )
    RETURN
        Result