cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerBoy
Helper I
Helper I

Understanding expanded tables

Hello,

Please, consider this situation:

Product table, with a one-to-many relationship with a Sales table (following case presented in this sqlbi.com article).

I want to understand the behaviour of using expanded tables. 

If I write this measure:

 

 

 

NumOfProductsSold = CALCULATE ( COUNT('Product'[ProductKey]), Sales )

 

 

 


It will return me the number of products sold, but a distinct list of the products sold, not a simple count of products. 
Why?
Isn't this using the expanded tables of Sales, and therefore the related Product columns of this expanded table? If this was the case the values would not contain only the distinct values.
Can anybody please clearly explain what is going on?

 


Thanks,

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@PowerBoy 

 

See LEFT OUTER JOIN in https://www.sqlbi.com/articles/expanded-tables-in-dax/ and learn https://www.sqlbi.com/articles/capturing-power-bi-queries-using-dax-studio/.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@PowerBoy 

 

See LEFT OUTER JOIN in https://www.sqlbi.com/articles/expanded-tables-in-dax/ and learn https://www.sqlbi.com/articles/capturing-power-bi-queries-using-dax-studio/.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors