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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
matrix_user
Helper III
Helper III

Extract and display text from dim table based on what is on fact table

Hello I would like help on creating a calculated column to display addresses from a dim table based on the post code in a fact table. I already have the two tables related via postcodes.

 

So, the addresses in green below are displayed in a new created calculated column.

 

Address Dim Table.jpg

 Thanks in advance,

2 ACCEPTED SOLUTIONS
Samarth_18
Community Champion
Community Champion

Hi @matrix_user ,

 

Sorry If I misunderstood your question,

Why do you need to refer fact table when you have everything available in dimention to create a address column. You could directly create a column as below:-

Address = [Postcode]&" "&[Locality]&" "&[State]&" "&[Country]

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

Anonymous
Not applicable

Hi @matrix_user ,

 

The problem is that when the Post Code is used as a key in the dimension table, its value should be unique.

 

For example, we create a calculated column in the fact table. When the calculated column is iterated in the first row of the fact table, go from the fact table to the dim table to find the record with postcode="0200", but the dim table has two such records. , so it doesn't know which record to return.

vcgaomsft_0-1655358335975.png

It is recommended that you consider rebuilding the dim table so that the dim table is on the "1" side of the relationship.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

6 REPLIES 6
matrix_user
Helper III
Helper III

Hello Samarth_18

 

Thank you for your reply. I may have not illustrated it properly. A further illustration is attached below. My fact table gets updated with new postcodes only, (no Locality, or State). The dim table is somewhat a complete reference of all the postcode of Australia with Locaility, States, Country and other data such as Latitude and Longitude coordinates.

 

So to create addresses in the fact table, I was thinking of linking it to the dim table so everytime there is a refresh, the fact table will be assigned a  complete address from the dim table.

 

From there, I can use the map visuals and drag the addresses field.

 

matrix_user_0-1655200095824.png

 

@matrix_user , I would suggest you to create a column in fact table as below:-

 

Address =
RELATED ( dim_table[Postcode] ) & " "
    & RELATED ( dim_table[Locality] ) & " "
    & RELATED ( dim_table[State] ) & " "
    & RELATED ( dim_table[Country] )

 

  

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Yes I tried that but even though I related postcodes between the fact and dim table, Power BI seems to say the " the Locality [Postcode] either doesn't exist or doesn't have a relationship to any table available in the current context" When I managed the relationship, I could only use the many to many  cardinality and cross filter both.

Anonymous
Not applicable

Hi @matrix_user ,

 

The problem is that when the Post Code is used as a key in the dimension table, its value should be unique.

 

For example, we create a calculated column in the fact table. When the calculated column is iterated in the first row of the fact table, go from the fact table to the dim table to find the record with postcode="0200", but the dim table has two such records. , so it doesn't know which record to return.

vcgaomsft_0-1655358335975.png

It is recommended that you consider rebuilding the dim table so that the dim table is on the "1" side of the relationship.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Thank you both Samarth_18 and Gao

Samarth_18
Community Champion
Community Champion

Hi @matrix_user ,

 

Sorry If I misunderstood your question,

Why do you need to refer fact table when you have everything available in dimention to create a address column. You could directly create a column as below:-

Address = [Postcode]&" "&[Locality]&" "&[State]&" "&[Country]

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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