Forum Discussion

vwiles84's avatar
vwiles84
Helper III
2 years ago
Solved

Sum 2 measures while excluding a date

I have a measure I need to create that will sum two values but not sum them if the date is a particular date range.  I don't want to exclude the data from being in the total, but I don't want it to s...
  • ryan_mayu's avatar
    2 years ago

    maybe you can try ,

    =if(max('Date')=date(2023,3,22)||max('Date')=date(2023,3,23),[Donor Count], [Total Store Donor Count])

  • AndyEagleton's avatar
    2 years ago

    This is essentially an IF statement impacting the line values but not the total. Assuming dates to exclude is a hard coded range somethingl like this:

    Total * =
    
    VAR DatesToExclude = CALENDAR ( DATE ( 2020, 3, 4 ), DATE ( 2020, 3, 10 ) )
    
    VAR CurrentDate = SELECTEDVALUE ( Dates[Date] )
    
    RETURN
        IF ( CurrentDate IN DatesToExclude, [Donor Count], [Donor Count] + [Donation ALL] )