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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to force or make a measure to use the relationship in DAX

Hi all,

 

I have two "Many to One" relationships in the Tabular Model to Dates table where Table1 is a Fact table and Dates is a dimensin table as mentioned below:

'Table1'[Date Key] --> 'Dates'[Date Key]

'Table1'[ReceiptDateKey] --> 'Dates'[Date Key]

 

I have a measure X which is SUM ( 'Table1'[Sale] ), I wanted to force or make this measure X to use the relationship 'Table1'[ReceiptDateKey] --> 'Dates'[Date Key] in the DAX calculations.

How I can achieve this, please can you help with DAX Command.

 

Regards,

 

Ranjan.

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

I assume you have active relationship: 'Table1'[Date Key] --> 'Dates'[Date Key]

                              inactive relationship: 'Table1'[ReceiptDateKey] --> 'Dates'[Date Key]

 

Please try the below.

 

Measure X = calculate ( SUM ( 'Table1'[Sale] ), userelationship ( 'Table1'[ReceiptDateKey] , 'Dates'[Date Key] ))

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



View solution in original post

Anonymous
Not applicable

Thank you @Jihwan_Kim for the information. I will give it a go and update if it works fine.

 

Regards,

 

Ranjan.

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

I assume you have active relationship: 'Table1'[Date Key] --> 'Dates'[Date Key]

                              inactive relationship: 'Table1'[ReceiptDateKey] --> 'Dates'[Date Key]

 

Please try the below.

 

Measure X = calculate ( SUM ( 'Table1'[Sale] ), userelationship ( 'Table1'[ReceiptDateKey] , 'Dates'[Date Key] ))

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Anonymous
Not applicable

Thank you @Jihwan_Kim 

To be honest, I will be creating the second relationship 'Table1'[ReceiptDateKey] --> 'Dates'[Date Key] and first relationship already exist in the model - 'Table1'[Date Key] --> 'Dates'[Date Key]

I don't know how to verify active and inactive relationships in the model, is there a way to check this or we need to assign active or inactive in the relationships/measure somewhere?

 

Regards,

 

Ranjan

Hi, @Anonymous 

If you have only one relationship between two tables, the connected line on the Data Model Page will show a line (active).

If you create a second relationship between the same-two tables, that already have the first relationship, the second connection line will show a dotted line (inactive).

You can control which one shows the active line and which one shows the inactive line.

 

Thank you.

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Anonymous
Not applicable

Thank you @Jihwan_Kim for the information. I will give it a go and update if it works fine.

 

Regards,

 

Ranjan.

Anonymous
Not applicable

Thanks @Jihwan_Kim for the DAX command and it works fine.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors