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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Are there DAX implications for using primary keys in dimension tables?

I have a PBI data model, which is a star schema, but am wondering if there are any DAX implications for the design (I know certain data model designs can cause undesired results when writing DAX measures, e.g. auto-exist in conjunction with a single table model).

 

My fact table in PBI looks like this (there are a few more columns); it's a database view:

development_PK   development_spend
DEV0001          £1000
DEV0002          £3000
DEV0003          £2000

To bring in a new dimension (something I want to filter or slice by), I create a view in the database that has the development_PK and the relevant value from the location table:

development_PK   location
DEV0001          UK
DEV0002          France

I'll then join on development_PK in the PBI data model.

 

I could, of course, bring the primary key from the location table into the view I'm using for the fact table, where it would be a foreign key, and then simply connect to the location table.

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , if this direct query then it is not a good option. But if it import mode, a view with distinct is fine. You can do that in power bi too.

 

refer: https://www.youtube.com/watch?v=kU2M1LmNvNo

DAX

https://www.youtube.com/watch?v=vYxWyt0qNUQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

It's import. What do you mean what when you say: 'a view with distinct' please? Thanks.

 

PS I know how to create the tables in Power Bi. I'm asking if the dimension not including it's own Primary key is an issue.

Hi  @Anonymous ,

 

It is a good practice if the dimension includes it's own Primary key because it helps ensure that all your facts reference existing dimension members, and may improve performance but it is not mandatory.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.