Forum Discussion

flintstone's avatar
flintstone
Icon for Helper II rankHelper II
5 years ago
Solved

Postcode mapped to state in Malaysia

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

  • 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:

    Another table without State:

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

    Result:

    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.

2 Replies

  • 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:

    Another table without State:

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

    Result:

    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.