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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Royal_Trudel
Frequent Visitor

One store with two possible IDs, how do I relate the fact table and dimension table?

Hello fellow users! I've run into a small issue when dealing with my fact and dimension tables.

In our franchise, we have two iFood stores for some of our operations (not all of them) for marketing reasons... The problem is that, for instance, I can't relate ID 85 to Store2, for instance.

 

Below is an example of how my fact table looks:

fact.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And here is an example of my dimension table:

dimension.png

 

 

 

 

 

 

 

 

As you can see, some of the stores don't have a second ID.

 

 

Any ideas on how I could relate these informations?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Royal_Trudel 

 

You can try the following methods.
New Table:

Table = 
Var _Table1=SUMMARIZE('DIMENSION','DIMENSION'[ID1],'DIMENSION'[Store])
Var _Table2=SUMMARIZE('DIMENSION','DIMENSION'[ID2],'DIMENSION'[Store])
Return
FILTER(UNION(_Table1,_Table2),[ID1]<>BLANK())

vzhangti_0-1673493446097.png

vzhangti_1-1673493470915.png

Result:

vzhangti_2-1673493519123.png

Is this the result you expect? If not, let us know what you expect the output to be.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Royal_Trudel 

 

You can try the following methods.
New Table:

Table = 
Var _Table1=SUMMARIZE('DIMENSION','DIMENSION'[ID1],'DIMENSION'[Store])
Var _Table2=SUMMARIZE('DIMENSION','DIMENSION'[ID2],'DIMENSION'[Store])
Return
FILTER(UNION(_Table1,_Table2),[ID1]<>BLANK())

vzhangti_0-1673493446097.png

vzhangti_1-1673493470915.png

Result:

vzhangti_2-1673493519123.png

Is this the result you expect? If not, let us know what you expect the output to be.

 

Best Regards,

Community Support Team _Charlotte

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

FreemanZ
Super User
Super User

hi @Royal_Trudel 

your sample data seems unable to reflect the issue. are you going to update it? Or could you explain further?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors