Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I want to use the IN operator in a measure to calculate a sum. If I enter the needed criterias directly it works and provides the correct results, e.g.
@cb123456 , Now sure Why are you doing like that
you can try
CALCULATE(SUM(Table2[sales]);FILTER(Table2;Table2[AC_key] IN value(Table1[Key]) ))
or
CALCULATE(SUM(Table2[sales]);FILTER(Table2;Table2[AC_key] IN summarize(filter(Table1[Field]="M007"),Table1[Key])))
or refer
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/
@amitchandak Thanks for your response and your support! Attached an example of my data structure. Table 1 contains information for different contracts. For each contract I need to calculate the sales that are stored in table 2 based on the entries made under the different FIELDCOMB. So for Num 1 I need the sales from table 2 where O004=AA and C001 = 123456 and O002 =ABC etc. And for Num 2 I need the sales where O002=ABC and C001=234567 and also C001 = 123456 and M007 is not AER, AEU, AEV, AEW, AEZ (Each entry can either be "inclusive" I or "exclusive" E). So I have multiple lines per contract that I need to evaluate based on columns in theTable 2.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |