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
Anonymous
Not applicable

Extracting information from second table using ID (dataset data model so measures only?)

Hi there,

 

Bit of a complicated one and as I'm not too experienced with working with PowerBI datasets, I am a little stumped on how to proceed due to the limitations.

 

What I have currently are two tables. Issue and Issue Attributes. I am trying to extract the data from the Issue Attributes table into the dashboard. Both tables have an Issue_ID number but only Issue has the "Created Date" field which I would like to use as a filter. 

 

Normally I would just create a relationship between the two tables to allow me to reference the Issue table via the Issue ID to get the "Created Date" values but this is a company dataset I am linking to and the data model does not seem to have a relationship modelled between the two. I am also limited to creating measures only and no calculated columns due to the dataset.

 

I have tried using vlookupvalue and it will return the result I'm looking for but only one instance of it (I cannot seem to pass the list of issue_id as a parameter for searching).

 

Any ideas? Some sample data below:

Issue

Issue_IDCreated DateCreated By
116525/03/2022Jack Montogomery
214913/04/2022Mark Mitchell
103216/06/2022Mark Mitchell

 

Issue Attributes

Issue_IDIssue TypeIssue Details
1032SafetyPPE
1165SafetyTrip Hazard
2149EnvironmentalDirty Water
2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

If the entries in the Issues table are unique, i.e. it would have been a one-to-many relationship, then you can create a measure like

Created date measure = CALCULATE( SELECTEDVALUE(Issue[Created Date]), 
    TREATAS( { SELECTEDVALUE('Issue Attributes'[Issue_ID]) },Issue[Issue_ID] )
)

and put that into a visualisation with details from the Issue Attributes table

View solution in original post

goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Try using the TREATAS() function to apply filtering contextbetween two unrelated tables. Dont forget to use the VALUES() function the "many" side of the relationship. Something like:

Measure =
CALCULATE(
SELECTEDVALUE(Issue[Created Date]), 
TREATAS( VALUES(Issue[Issue_ID]) , 'Issue Attributes'[Issue_ID])
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you both, let me try those solutions and get back to you

goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Try using the TREATAS() function to apply filtering contextbetween two unrelated tables. Dont forget to use the VALUES() function the "many" side of the relationship. Something like:

Measure =
CALCULATE(
SELECTEDVALUE(Issue[Created Date]), 
TREATAS( VALUES(Issue[Issue_ID]) , 'Issue Attributes'[Issue_ID])
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

johnt75
Super User
Super User

If the entries in the Issues table are unique, i.e. it would have been a one-to-many relationship, then you can create a measure like

Created date measure = CALCULATE( SELECTEDVALUE(Issue[Created Date]), 
    TREATAS( { SELECTEDVALUE('Issue Attributes'[Issue_ID]) },Issue[Issue_ID] )
)

and put that into a visualisation with details from the Issue Attributes table

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.