Forum Discussion

ekaponkratova's avatar
ekaponkratova
Frequent Visitor
7 years ago
Solved

Calculation when no country is selected

I have the below dataset and user country as a filter. The task is to calculate the revenue - calculated as sum paid in this month -  sum paid in the previous month. It should be calculated in USD. T...
  • v-frfei-msft's avatar
    7 years ago

    Hi ekaponkratova ,

     

    To update your measure as below.

     

    final_calc =
    IF (
        ISFILTERED ( Sheet1[country] ) = FALSE (),
        CALCULATE (
            SUM ( Sheet1[cum sum paid] ),
            DATEADD ( 'calendar_3'[Date], -1, MONTH ),
            Sheet1[country] = "Spain"
        )
    )