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
Anonymous
Not applicable

Two fields in fact table to the same dimension table

Good day everyone,

 

I'm having trouble modelling this. I have this fact table with two columns, one each for a voyage;

1) The voyage to our warehouse

2) The voyage from our warehouse 

 

Now I got this dimension table with all voyages in the same column.

 

How do I shape this into a star schema, so that all my relationships stay active? I've been thinking about making two bridge tables, one for each type of voyage. And then link those to my dimension. But that seems kind of weird way to solve this.

 

2022-01-25 20_21_58-Presentation1 - PowerPoint.png

 

Thanks!

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

You may consider using Lookupvalue() function to search the desired column.

https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

 

Best Regards,

Liu Yang

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

Maulik_Domadia
Regular Visitor

Hello,

You can try UserRelationship dax or you can create a key in Fact Table and Dim table then you can probably use to create Star Schema. 

Can you please share a demo file which covers your case?

bcdobbs
Super User
Super User

What is the grain of your fact table. Eg what does one row represent?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Anonymous
Not applicable

Hi @bcdobbs ,

One row in my fact table represents an entire trip (transport), so get goods somewhere, to our warehouse, and deliver them somewhere else. That's why I have both the voyage_in and voyage_out on the same row.

 

What would you suggest I do?

 

Thanks

I'd probably have two dimensions which could essentially be copies of each other. One being an origin dimension and another being a destination.

You then effectively have a factless fact table that describes transit between origin and destination. 

As @Maulik_Domadia said you could leave it

from one dimension and use USERELATIONSHIP in a measure but then you're moving a lot of work to dax rather than having a clear model.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

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.