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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Dunner2020
Post Prodigy
Post Prodigy

Duplicate primary key in dimension table

Hi there,

I have a data model which looks like as follow:

leo_89_1-1618865112915.png

 

Two tables are connected through EpochHH column. EpochHH is the unique number to represent the half-hour time slot in any given date. I want to create a new column in Table 2 that sum up Raw GI value occured in same EpochHH. To create a column, first I used the merge queries option in the power query editor to bring the Raw GI column in Table 2. I brought it the Raw GI value in Table 2 as shown in figure:

leo_89_2-1618865202778.png

 

However, when I click on apply and close option, it throws following option:

leo_89_0-1618865076448.png

 

I checked the Table 2 and it does not contain duplicate value of 110323. I am not sure how to fix the issue. Could you please help me in fixing the issue?
File can be download from here 

 

1 ACCEPTED SOLUTION
MURTAZA
Resolver I
Resolver I

@Dunner2020When you merge the table, it creates multiple instances of the primary key, to join the table, hence making it many to many relationship.

To bring column from many side of the relationship to 1 side, you can simply use Calculated Column and an aggregated function.

You can try this. Go to Table 2. Click New Column and paste this:

Raw GI =
CALCULATE(
SUM('Table 1'[Raw GI]
)
)

Let me know if this solves your problem.

View solution in original post

1 REPLY 1
MURTAZA
Resolver I
Resolver I

@Dunner2020When you merge the table, it creates multiple instances of the primary key, to join the table, hence making it many to many relationship.

To bring column from many side of the relationship to 1 side, you can simply use Calculated Column and an aggregated function.

You can try this. Go to Table 2. Click New Column and paste this:

Raw GI =
CALCULATE(
SUM('Table 1'[Raw GI]
)
)

Let me know if this solves your problem.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors