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
syeena
Frequent Visitor

Creating Relationship between 2 Different Datasets

Let's say I have 2 existing Datasets, one is AnimalInfo and another is Owner. In the Owner dataset (xls. format) consist of 3 sheets aka 3 owners. In the visualization, for instance I have slicer that is able to choose the animal from AnimalInfo set. Then I have a table where the Animal is displayed when chosen from the slicer, as well as display the owner's name indicating that the owner has the Animal chosen, as a Pet. How do I achieve this?

Examples of the desired output when choosing "Cat" in the slicer:

AnimalAraKenEva
CatCat (Wendy)n/aCat (Loli)

Another example when choosing "Fish" in the slicer:

AnimalAraKenEva
Fishn/a

Fish (Joji)

Fish (Poppy)

n/a

AnimalInfo Dataset

AnimalColour
CatWhite
DogBrown
FishOrange

Owner Datasets

Ara (sheet1)

Name of the PetPet
BenDog
WendyCat

 

Ken (sheet2)

Name of The PetPet
JojiFish
PoppyHen

Eva (sheet3)

Name of The PetPet
Loli

Cat

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @syeena - you can append these three sheets (Ara,Ken and Eva) into a single table named as Owner

 

rajendraongole1_0-1722504846246.png

Rename columns appropriately for consistency (e.g., Name of the Pet to Pet Name, Pet to Animal).

rajendraongole1_1-1722504921473.png

 

create a relationship between owner table and Animal tables as lik below

rajendraongole1_2-1722504996584.png

 

 

create a new table as 

 

OwnerMapping =
DATATABLE (
"Owner", STRING,
{
{ "Ara" },
{ "Ken" },
{ "Eva" }
}
)

Now create individual measure for each owner

Ara_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Ara" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

Ken_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Ken" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

Eva_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Eva" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

 

Hope it works

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

sudhisami_azure
Frequent Visitor

Hi Syeena,

I found it much easier to achieve the desired result using Power Query and a matrix table. This method eliminates the need for DAX functions.

You can download the PBIX file from this link: [Download PBIX File](https://drive.google.com/file/d/1o6uTVY-O_wELcH4-6rK0Lr1Gr6Lo-eqT/view?usp=sharing).

Best regards,

View solution in original post

4 REPLIES 4
sudhisami_azure
Frequent Visitor

Hi Syeena,

I found it much easier to achieve the desired result using Power Query and a matrix table. This method eliminates the need for DAX functions.

You can download the PBIX file from this link: [Download PBIX File](https://drive.google.com/file/d/1o6uTVY-O_wELcH4-6rK0Lr1Gr6Lo-eqT/view?usp=sharing).

Best regards,

thank you so much! this is very helpful

rajendraongole1
Super User
Super User

Hi @syeena - you can append these three sheets (Ara,Ken and Eva) into a single table named as Owner

 

rajendraongole1_0-1722504846246.png

Rename columns appropriately for consistency (e.g., Name of the Pet to Pet Name, Pet to Animal).

rajendraongole1_1-1722504921473.png

 

create a relationship between owner table and Animal tables as lik below

rajendraongole1_2-1722504996584.png

 

 

create a new table as 

 

OwnerMapping =
DATATABLE (
"Owner", STRING,
{
{ "Ara" },
{ "Ken" },
{ "Eva" }
}
)

Now create individual measure for each owner

Ara_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Ara" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

Ken_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Ken" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

Eva_Pets =
CONCATENATEX (
FILTER (
Owner,
Owner[Owner] = "Eva" &&
Owner[Animal] = SELECTEDVALUE ( AnimalInfo[Animal])
),
Owner[Pet Name],
", ",
"n/a"
)

 

Hope it works

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





i tried this as well, it works! but quite difficult if these data are in a large volume

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.