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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chahineatallah
Helper III
Helper III

Relations & models

Hello Everyone

 

Wanted to ask you, i have a relation between sales & store (1 to many) & product to sales (1 to many)

my question, how to make it to display only products available in certain store, for example if i choose store 3,  i want it to display only products of store 3, should i do a new table for that or is there some tip for that? thanks

relation store vs product.pngstore ID vs products.png

8 REPLIES 8
chahineatallah
Helper III
Helper III

hi again

in my model i have customer table which is related to sales table

also i have product table related to sales table

 

now when i create a matrix with customer ID & product, i get the products for each customers & sales for each customer by product,  how is that? as customer & products are not related , to my knowledge it should not work

Thanks

customer product relation.pngrelation model.png

link to my file

https://catallah-my.sharepoint.com/:u:/g/personal/chahineatallah_catallah_onmicrosoft_com/ESJ6nEkGn8... 

chahineatallah
Helper III
Helper III

thank you

v-mengzhu-msft
Community Support
Community Support

Hi @chahineatallah ,

 

I checked the PBIX file you shared and found that you selected the "store id" in the "Store Lookup" table, which only contains the number 5.

vmengzhumsft_0-1658825541797.png

In “Food Inventory”, the “store id” contains 3.

vmengzhumsft_1-1658825541810.png

 

So you can change the table and then you will get what you want: display only products of store 3.

vmengzhumsft_2-1658825541820.png

This is the PBIX file, you can directly to view it for understanding.

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, however, I tried to create a sample pbix file like the below.

One way to do is, insert a Sales total measure into the Filters pane and select the condtion = "is not blank".

 

Please check the below picture and the attached pbix file.

 

Untitled.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


hi yes this what i want, but why in my model i have blank in store

 

so as summary , i have a model with store lookup,  product lookup, and sales 

i have also created a store parameter (just for training purposes), when i choose my parameter as store 3, i want it to show me only products in that store & its sales, this is link to my file, dont know why i couldnt attach

maven roasters pbcommunity.pbix

 

Hi,

Sorry that it is quite difficult for me to understand your data model.

 

Store Lookup table: only has store_id = 5

Sales by Store table: it has store_id = 3,5,8

 

I think, you cannot show store 3 and 8 by using store lookup table. It is correct that it only shows sotre 5, and rest of stores are shwon as blank, because only store 5 information exists.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


SpartaBI
Community Champion
Community Champion

@chahineatallah you have few options to do that.
The wrong one will be to use bi directional filters.
The right one will be to create a help measure for that.
Here is a tutorial that explains how to do that:
https://www.sqlbi.com/tv/syncing-slicers-in-power-bi/


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Thanks will check it out

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors