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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using RELATED for tables

Hi,

 

In one of Udemy's example exams, there is a question about two tables - SALES and CITY DATA. They look as following:

 

City data

State (citydata)cityPopulation (million)
   

 

Sales

State (sales)TypeSales
   

 

State in both tables contain similar values.

 

In the question you have to say whether a statement is correct or not. The following statement is, according to them, incorrect. However, I don't understand why, as the function RELATED is working on the one-side of relationships, that can import a column into the sales table:

  • In the Sales table, you can write a DAX expression that uses the RELATED() function to get data from the City data table.

Can anyone explain?

1 ACCEPTED SOLUTION
bcdobbs
Super User
Super User

Looking at the tables:

Sales is at the state granularity.

The city table is at the city granularity so each state there has multiple cities. Eg it might look like:

 

StateCity
A1
A2
A3
B4
B5
B6
C7
C8

 

(Note City is unique but State is repeated).

 

You can join state to state between the tables but it will be many to many not 1 to many.

 

RELATED as you're aware only gets data from the 1 side of a 1 to many relationship.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
bcdobbs
Super User
Super User

Looking at the tables:

Sales is at the state granularity.

The city table is at the city granularity so each state there has multiple cities. Eg it might look like:

 

StateCity
A1
A2
A3
B4
B5
B6
C7
C8

 

(Note City is unique but State is repeated).

 

You can join state to state between the tables but it will be many to many not 1 to many.

 

RELATED as you're aware only gets data from the 1 side of a 1 to many relationship.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Anonymous
Not applicable

Thanks! I understand it now.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors