Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Active cases Logic

Hello all, I have active cases count in Line chart in PBI, when I drill down to Month level I can see each Month's Active cases count, but when I drill up the whole year active cases should be the...
  • Greg_Deckler's avatar
    2 years ago

    Anonymous Try the following. PBIX is attached below signature.

    Measure = 
        VAR __LastDate = MAX('Table'[FIRST_DAY_OF_MONTH])
        VAR __LastNumber = SUMX(FILTER('Table', [FIRST_DAY_OF_MONTH] = __LastDate), [CASE_KEY])
        VAR __Result = IF(HASONEVALUE( 'Table'[FIRST_DAY_OF_MONTH] ), SUM('Table'[CASE_KEY]), __LastNumber)
    RETURN
        __Result