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
LUCASM
Helper III
Helper III

Search calendar table to multiple fact tables date/date exit problem

I have 75 all SQL tables that I don't have access to, most of which are linked and some have a date field and some have a datetime field

I have also created a lookup table [calendar] which for example I want to return the start of the week date - there might be other fields that I want to return.

The problem I'm having is that if 2 tbles are linked by an [ID] key and I want to use the calendar to return the start date of the week based on a field created in each Power BI table will not allow me to activate it.

This becomes more complex, because there is no datetime field in the [Calendar] table.

So I need to find a way to have a lookup table and convert the date and time stamp to a date during the search.

Any idea.

As this is quite complex I have linked a much simpler pibx file.

Example pbix

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @LUCASM 

In fact ,DAX allows you to override the active relationship and use the inactive relationship in your formulas instead.  To do this, you must use the DAX function USERELATIONSHIP inside a CALCULATE function.

 

For more details ,you can refer to this post.

multiple-relationships-between-tables-in-dax

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @LUCASM 

In fact ,DAX allows you to override the active relationship and use the inactive relationship in your formulas instead.  To do this, you must use the DAX function USERELATIONSHIP inside a CALCULATE function.

 

For more details ,you can refer to this post.

multiple-relationships-between-tables-in-dax

 

Best Regards,
Community Support Team _ Eason

Greg_Deckler
Super User
Super User

I get this when trying to access the PBIX

image.png


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thats strange

 

I'll try again

 

Example file 

 

....my bad it was a typo. The problem with copying the link by eye and not cut and pasting.

I'll hang my head in shame.

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.