Forum Discussion

Julia_Mav's avatar
Julia_Mav
Icon for Helper II rankHelper II
3 years ago
Solved

Calculate and two filters

Hi all, I want to get the values of yesterday's sales from country USA. To do that, I tried the measure below:   For yesterday = CALCULATE(     [Sales USD],     FILTER (         ALL ( 'TY Grou...
  • Greg_Deckler's avatar
    3 years ago

    Julia_Mav Maybe:

    For yesterday =
    
    CALCULATE(
    
        [Sales USD],
    
        FILTER (
    
            ALL ( 'TY Group'[Country],'TY Group' [Calendar Day] ),
    
            'TY Group'[Country]="USA" && 'TY Group'[Calendar Day]  = TODAY()-1))

    However, if you are using a single table data model, you may be running into issues with CALCULATE. What is the formula for your [Sales USD] measure?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Julia_Mav

     

    I guess, I would try to use && instead of ||. At the moment your DAX formula is just considering one of the two criterias.