Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
This pattern leverages the Expanded Table behavior of DAX. Your products table is part of the expanded Sales table. You can read more about Expanded Table here.
Expanded tables in DAX - SQLBI
Pat
Hi @Anonymous
I've never used this method before (placing the fact table in the CALCULATE filter when calculating a measure related to dimension table) but I noticed that many people do that and it works. It seems that when doing that the engine intersects the product keys in your case from the product table with the product keys from the sales table which is filtered by country/region from the country table. Usually I would make the code more meaningful by CROSSFILTER the relationship between Sales and Products to BOTH. That would work as well. Country filters Sales and Sales cossfilters Products.
@Anonymous
You can also SUMMARIZE the Sales table (which is already filtered by County) by 'Product'[Product Key]. That would provide the best performance among all the three options.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |