Forum Discussion
Julia_Mav
Helper II
3 years agoCalculate 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...
- 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?
- Anonymous3 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.
Greg_Deckler
Community Champion
3 years agoJulia_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?
Julia_Mav
Helper II
3 years agoThank you Greg_Deckler!!! It works now.