Forum Discussion
dokat
Post Prodigy
4 years agoSum based on two criteria
Hi, I have a data table where i would like to data where two conditions meet. The name of teh table is P&L I'd would like to pull data where Cleandar Year= 2021 and P&L= Off Invoice Sales ...
- 4 years ago
Try:
CALCULATE(
SUM('P&L'[Values]),
'P&L'[P&L]= "Off Invoice Sales",'P&L'[Calendar Year]= 2021
)
I've tidied the code and also made calendar year equal just 2021.
If your calendar year is a date column use DATE(2021, 12, 31) to ensure it's being parsed correctly.
bcdobbs
Community Champion
4 years agoTry:
CALCULATE(
SUM('P&L'[Values]),
'P&L'[P&L]= "Off Invoice Sales",
'P&L'[Calendar Year]= 2021
)
I've tidied the code and also made calendar year equal just 2021.
If your calendar year is a date column use DATE(2021, 12, 31) to ensure it's being parsed correctly.
- dokat4 years ago
Post Prodigy
Yes it worked with DATE(2021, 12, 31).
Thanks