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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
NoobAnalyst01
Helper I
Helper I

Return value from another table with one to many relationship within those two tables

Hello,

 

I have two tables with the relationship below and sample data as below:Image 18.jpgImage 19.jpg

 

in the ASEET TABLE, for example, how can I added an column the get the value for "region" from ASSET_ATTRIBUTE table,basically need to filter asset_attribute table by type="region" and then get the value where asset_id=asset_id

Image 20.jpg

 

Thanks

Frank

2 ACCEPTED SOLUTIONS
v-xjiin-msft
Solution Sage
Solution Sage

Hi @NoobAnalyst01,

 

To achieve your requirement, please try following method, see if it works for you:

 

DOMICILE =
CALCULATE (
    MAX ( ASSET_ATTRIBUTE[VALUE] ),
    FILTER (
        ASSET_ATTRIBUTE,
        ASSET_ATTRIBUTE[TYPE] = "REGION"
            && ASSET_ATTRIBUTE[ASSET_ID] = ASSET[ASSET_ID]
    )
)

5.PNG

 

Thanks,
Xi Jin.

View solution in original post

Hi Jin,

 

Thanks,

 

this works for me.

 

the only question i have is why in my filter statement, i should include a asset_id=attrtibute_value.

 

becaue in my relationship, i alredy join those two tables together 1:m relationship.

 

but when I remove the a asset_id=attrtibute_value in my formula, it doen't work, just wonder is there any reason why we should include this?

 

Thanks

Frank

View solution in original post

7 REPLIES 7
v-xjiin-msft
Solution Sage
Solution Sage

Hi @NoobAnalyst01,

 

To achieve your requirement, please try following method, see if it works for you:

 

DOMICILE =
CALCULATE (
    MAX ( ASSET_ATTRIBUTE[VALUE] ),
    FILTER (
        ASSET_ATTRIBUTE,
        ASSET_ATTRIBUTE[TYPE] = "REGION"
            && ASSET_ATTRIBUTE[ASSET_ID] = ASSET[ASSET_ID]
    )
)

5.PNG

 

Thanks,
Xi Jin.

Thank you for this! This helped me on a separate issue where "LOOKUPVALUE" was not working.

Hi Jin,

 

Thanks,

 

this works for me.

 

the only question i have is why in my filter statement, i should include a asset_id=attrtibute_value.

 

becaue in my relationship, i alredy join those two tables together 1:m relationship.

 

but when I remove the a asset_id=attrtibute_value in my formula, it doen't work, just wonder is there any reason why we should include this?

 

Thanks

Frank

TomMartens
Super User
Super User

Hey,

 

I would recomend that you take a look at the DAX function LOOKUPVALUE

https://msdn.microsoft.com/en-us/query-bi/dax/lookupvalue-function-dax

 

From a first glance at your 2 tables I would suggest that you consider to restructure your ASSET_ATTRIBUTE table, create new columns from the Type column for all your asset ids.

 

As far as I can guess all the types are describing  the asset anf for this reason it would make sense to transform your wide table into a long table.

 

Even if this article was not written with Power BI tables in mind it is the shortes read about tidy data 🙂

https://www.jstatsoft.org/article/view/v059i10/v59i10.pdf

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

there is a alteltive solution i think is duplaice the attribute table for 3 tables, and each table filter one type in the query editor step; then it will be one to one relationship with the main table.

@NoobAnalyst01

 

May be

 

Domicile =
CALCULATE ( FIRSTNONBLANK ( ASSET_ATTRIBUTE[Region], 1 ) )

will try.

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.