Forum Discussion
Jensej
6 years agoHelper V
Measure with filter IN OR
Hey guys
Im pretty new to Power BI and having problems finding out how to include a second value for my filter in my measure.
I want to SUM the budgetamount for the Accounts 1000 and 2000 in one Measure.
I manage to do this with a single account in filter but i want to add the 2000 also. Just like in SQL where i can say where AccountNr IN (1000,2000)
Budget HR = CALCULATE(SUM(budget[amount],FILTER(budget,budget[AccountNr] = 1000)
2 Replies
- amitchandakSuper User
Jensej , try like
Budget HR = CALCULATE(SUM(budget[amount]),FILTER(budget,budget[AccountNr] in{ 1000,2000}))
if the column is text
Budget HR = CALCULATE(SUM(budget[amount]),FILTER(budget,budget[AccountNr] in{ "1000","2000"}))
- az38Community Champion
Hi Jensej
Budget HR = CALCULATE(SUM(budget[amount],FILTER(budget,budget[AccountNr] = 1000 || budget[AccountNr] = 2000))or
Budget HR = CALCULATE(SUM(budget[amount],FILTER(budget,budget[AccountNr] IN {"1000", "2000"} ))or
Budget HR = CALCULATE(SUM(budget[amount],FILTER(budget, OR(budget[AccountNr] = 1000, budget[AccountNr] = 2000)))