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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
flintstone
Helper II
Helper II

Postcode mapped to state in Malaysia

Hi! I have a columns of Malaysian postcodes and need help to convert these postcodes to Malaysian states. 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @flintstone 

 

You could create a postcode-state table, and then establish a one-to-many relationship between your dimension table and the fact table,

and then you can use the RELATED function to get the state information in the fact table.

mapped to State =
RELATED ( 'Postcode-State'[STATE] )

I created a simple sample to illustrate this, please allow me to use the reference information provided by @amitchandak 

Sample:

Postcode-State table:

v-angzheng-msft_0-1619689831645.jpeg

Another table without State:

v-angzheng-msft_1-1619689831648.jpeg

There is a one-to-many relationship between two tables.

v-angzheng-msft_2-1619689831650.jpeg

Result:

v-angzheng-msft_3-1619689831653.jpeg

Please refer to the attachment below for details

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
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-angzheng-msft
Community Support
Community Support

Hi, @flintstone 

 

You could create a postcode-state table, and then establish a one-to-many relationship between your dimension table and the fact table,

and then you can use the RELATED function to get the state information in the fact table.

mapped to State =
RELATED ( 'Postcode-State'[STATE] )

I created a simple sample to illustrate this, please allow me to use the reference information provided by @amitchandak 

Sample:

Postcode-State table:

v-angzheng-msft_0-1619689831645.jpeg

Another table without State:

v-angzheng-msft_1-1619689831648.jpeg

There is a one-to-many relationship between two tables.

v-angzheng-msft_2-1619689831650.jpeg

Result:

v-angzheng-msft_3-1619689831653.jpeg

Please refer to the attachment below for details

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.