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
Del235
Helper II
Helper II

Relationship with a Measure not working

I have created a table which has a field of the type Text.  I'm trying to join on another field in a table that is also of the type text but that field was created as a measure.  When try to create a relationship between the 2 Power BI doesn't "see" the field to create the relationship.

 

Why?

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

@Del235 Hello,@ExcelMonke ,thank you for your help of this issue.Your answer is excellent!
And I would like to share some additional solutions below.
I am glad to help you.

According to your description, you want to use measure to establish relationships with fields in other tables.

Unfortunately, this is not possible. Here are the results of my tests:

vjtianmsft_0-1715758539309.png

I tried to make the Resource Name in the Booking table related to the newly created measure M_, but it failed.

vjtianmsft_1-1715758561167.png

Here is the reason I analyzed, you can refer to it:

The relational model in power BI does not support a field in a table to establish a relationship directly with a newly created measure.

The reasons is as follows:

The relationship model between data in power bi is built before the data is loaded, while the measure is calculated after the data is loaded, it depends on the current computing environment. Simply put, measure must have specific data in order to work properly, while the relationship is not dependent on specific data.

If you want to achieve a similar effect, you can create a calculate column with the same functionality as the current measure to replace it. calculate column is similar to a normal column, you can use calculate column to establish relationships with other table fields.

Test Data:

vjtianmsft_2-1715758618476.png

M_ = 
SELECTEDVALUE('Resources'[Resource Name])
C_ = 'Resources'[Resource Name] 

Create a relationship with the "Resource Name" of another Booking table by calculating column C_ instead of M_.

vjtianmsft_3-1715758669130.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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-jtian-msft
Community Support
Community Support

@Del235 Hello,@ExcelMonke ,thank you for your help of this issue.Your answer is excellent!
And I would like to share some additional solutions below.
I am glad to help you.

According to your description, you want to use measure to establish relationships with fields in other tables.

Unfortunately, this is not possible. Here are the results of my tests:

vjtianmsft_0-1715758539309.png

I tried to make the Resource Name in the Booking table related to the newly created measure M_, but it failed.

vjtianmsft_1-1715758561167.png

Here is the reason I analyzed, you can refer to it:

The relational model in power BI does not support a field in a table to establish a relationship directly with a newly created measure.

The reasons is as follows:

The relationship model between data in power bi is built before the data is loaded, while the measure is calculated after the data is loaded, it depends on the current computing environment. Simply put, measure must have specific data in order to work properly, while the relationship is not dependent on specific data.

If you want to achieve a similar effect, you can create a calculate column with the same functionality as the current measure to replace it. calculate column is similar to a normal column, you can use calculate column to establish relationships with other table fields.

Test Data:

vjtianmsft_2-1715758618476.png

M_ = 
SELECTEDVALUE('Resources'[Resource Name])
C_ = 'Resources'[Resource Name] 

Create a relationship with the "Resource Name" of another Booking table by calculating column C_ instead of M_.

vjtianmsft_3-1715758669130.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ExcelMonke
Responsive Resident
Responsive Resident

You are not able to create a relationship using measures. A good way to think about it is, if the measure value changes, it will cause a Power BI to continuously change the relationship, and this may cause errors if the measure value is not as intended

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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