Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Dax - Date Filter

Hello people,   I have two measures for a date table, but for different periods:   Accounting period (mm/21/yyyy  to  mm+1/20/yyyy) Other Periods Example: MonthAccount =  8 (06/21/...
  • v-xuding-msft's avatar
    5 years ago

    Hi Anonymous ,

     

    Please try this:

    Measure =
    VAR CountMonthAccount_ =
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[MonthAccount] ),
            FILTER (
                'Table',
                'Table'[Date] >= MIN ( 'Date'[Date] )
                    && 'Table'[Date] <= MAX ( 'Date'[Date] )
            )
        )
    RETURN
        IF ( CountMonthAccount_ = 1, [Measure 1], [Measure 2] )
    
    Measure 1 = 1
    Measure 2 = 0