cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpatel Regular Visitor
Regular Visitor

Relationship between tables in DAX

Hi,

 

I am trying to test if there is a relation between two tables in power bi desktop by creating the following column :

 

Etat Paiement = IF(RELATEDTABLE('gest_asso ticket_rl');"Paid";"Not Paid")

 

schema.png

 

There is a relation between the two tables but i need to flag the row that are not related for the relation Activié => ticket_rl.

I have an error trying to compute the code mentionned before.

 

Anyone can give me a hint or a way to achieve that i want ?

 

Kind regards,

 

Mohammad

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables in DAX

You could try adding a calculated column to 'Activité' using the following code.  This will put a number for rows that match and you can use a filter to help identify the rows with no related rows.

 

Count of Related Rows = CALCULATE(COUNTROWS('gest_asso ticket_rl'))

Does that help you?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables in DAX

HI @mpatel

 

What columns do you use in the relationship between the two tables?

 

And are you trying to find the rows in 'gest_asso ticket_rl' that don't exist in 'Activié'

 

Phil


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

mpatel Regular Visitor
Regular Visitor

Re: Relationship between tables in DAX

Hi @Phil_Seamark,

 

Thanks for your reply.

 

The column used for the relationship between the two tables id ID.

 

What I am trying to do is to find rows in 'Activité' that do not exist in 'gest_asso ticket_rl'.

 

Mohammad

Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables in DAX

You could try adding a calculated column to 'Activité' using the following code.  This will put a number for rows that match and you can use a filter to help identify the rows with no related rows.

 

Count of Related Rows = CALCULATE(COUNTROWS('gest_asso ticket_rl'))

Does that help you?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Highlighted
mpatel Regular Visitor
Regular Visitor

Re: Relationship between tables in DAX

Yes thank you very much, it works and fits my needs.

 

 

Mohammad

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 405 members 4,158 guests
Please welcome our newest community members: