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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jjjppp
Frequent Visitor

Values replicated across dimension but relationship looks fine

Hi folks,

 

I'm mocking up a dataset to illustrate to someone how they might report on court cases, and the relationship between my two tables is not working. I've had a long day and my brain is fried, so maybe I'm missing something simple, but I just cannot figure out the issue.

 

This is what's happening to my viz: Average of Age measure is replicating across all members of Offense Type. Easy, right? It's probably a problem with the relationship.

jjjppp_0-1647898818657.png

 

Here are my relationship details

jjjppp_1-1647898898246.png

 

I know the values match in each column. I'm quite certain both are text type as well. Does anyone have an idea of why this relationship doesn't seem to be working? I know there are workarounds, but I feel like I'm going crazy as to why this is happening.

 

My apologies if I'm being dumb, but I've been staring at this for twenty minutes, and would like to just phone a friend and end my day. There's a link to a folder containing the file below. Thanks so much!

 

Link to file here: dax questions

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @jjjppp , It's because the relationship type is 1 to many, if you set the cross filter to both, it should work but please validate the results you are getting.

View solution in original post

4 REPLIES 4
davehus
Memorable Member
Memorable Member

Hi @jjjppp , It's because the relationship type is 1 to many, if you set the cross filter to both, it should work but please validate the results you are getting.

Hi @davehus,

 

That did fix it. It makes sense now. I'm so used to using dimensions from the 1 side on the axis.

jjjppp
Frequent Visitor

Hi @davehus,

 

Thanks for taking a look. I should have clarified--I know how to work around this using DAX or by merging the tables in Power Query. My question is why is happening in the first place when everything with the relationship seems in order. Any ideas?

Thanks!

davehus
Memorable Member
Memorable Member

Hi @jjjppp ,

 

Add a calculated column called Age to the case table. Age = Related(Age)

Average Age = AVERAGEX('cases','cases'[Age])
 
davehus_0-1647900144608.png

Please accept my answer if it is what you need.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!