Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

How this DAX function works. Please someone explain this, I am not able to understang it

Total Products with Regions =
CALCULATE(
    [Total Products],
        Sales)
//Used to work out how many customers sold to within each regions
3 REPLIES 3
ppm1
Solution Sage
Solution Sage

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

Microsoft Employee
tamerj1
Community Champion
Community Champion

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. 

tamerj1
Community Champion
Community Champion

@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. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.