1
votes

I am posting this here but I am having issues to post in Power BI community (for some reason keeps giving me errors when I post the question).

I am trying to get the total Previous Sales basedbut on certain conditions, I keep getting and error when I add IN to the formula:

PrevTotalSales =
Var prev = selectedvalue(sales(previousperiod)
RETURN 
CALCULATE ( 
COUNTA(Sales[SaleNbr]),(Sales[period]=prev), sales[code] in ("a","b","c")
)

Any suggestions? Thanks

2

2 Answers

2
votes

You need to use curly brackets {,} instead of parenthesis (,) for your list.

Your variable row also has issues, but this should fix your IN problem.

0
votes

This seems to be the answer you need.

Basically, instead of using Var in Var_List you need to change it to if List.Contains({Var_List},[Var]) then