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
Matt22365
Resolver III
Resolver III

Relationship issue between date fields

Hi
I hope someone can help
I have created a relationship between a date table and a database. The link is between "date" (from date table) and "date closed" (fromthe database)
The aim is to have a card which counts the amount of lines in the database based on how many have been closed in a selectable date range. However when I make this the card returns "(blank)".
Both columns are in date format, if I use the date closed as a filter and turn off the relationship it works, I have 4 other tables which all have relationships to date closed without any issues
Any help with why this relationship might not be working would be greatly appreciated
Thanks
Matt
1 ACCEPTED SOLUTION

Hi

Thanks for your support

The reason it was only matching 11 entries was due to the Database table "Date Closed" being retrieved in Date/Time format. Once I edited this it all worked.

Thank you for your time helping on this

Matt  

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Hi,

 
In the Edit Query Use the Merge Option and select left join Option between"Date" table and "Data Base" table. So it will filter the data from "Database" table based on "Date" table .

v-kelly-msft
Community Support
Community Support

Hi @Matt22365

 

If it returns "blank",it means that there's an error in your relationship. So,do you wanna keep the relaitionship?If yes,you can make the relationship inactive(shown as below),otherwise,you can directly delete the relationship.

 

131.png

If above cant solve your problem, can you share the picture of your relationship schema if there isnt any confidential

information inside?

 

Best Regards,

Kelly

Hi

Thanks for getting back to me

I have attached a pictue of my relationships (its a little complex as I link between a lot of tables). The only issue I am having is the highlighted blue line. I want the  "Date" Table to filter the "Database" table then a card to count the amount of lines where the date closed matches the filter. e.g. in 2019, how many lines of the database have been closed

ThanksBI Date Relationship Help.PNG

Matt 

 

Edit - to add a bit more information, if I make a table with both date fields in some dates to match up but not all, see picture below

BI Date Relationship Help 2.PNG

amitchandak
Super User
Super User

Refer my blog, how to handle two dates using same time dimension

HR-Analytics-Active-Employee-Hire-and-Termination-trend

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Morning

Thanks for getting back to me, I have used your article for a different issue but I think this requires a more simple fix

I have attached a pictue of my relationships (its a little complex as I link between a lot of tables). The only issue I am having is the highlighted blue line. I want the  "Date" Table to filter the "Database" table then a card to count the amount of lines where the date closed matches the filter. e.g. in 2019, how many lines of the database have been closed

ThanksBI Date Relationship Help.PNG

Matt 

 

Edit - to add a bit more information, if I make a table with both date fields in some dates to match up but not all, see picture below

BI Date Relationship Help 2.PNG

Hi @Matt22365 ,

 

Just now I used my sample data to test on your provided relationship schema,but I cant find what your problem is,as everything runs fine in here:

31.png32.png

 

So now pls advise me what the measure you are using?And in the table "Database",which column are you filtering with?

For my .pbix file, pls click here.

 

Best Regards,
Kelly

Hi

Thanks for getting back to me

I have created a link between "Date" and "Date Closed".

I havent created a measure for this calculation as the relationship between the Date and Stats tables is working correctly (without one) i.e. a card to count the amount of line where the published date meets the criteria of a sliced based on the Date column 

It appears that the link is working as 11 of the 2019 rows are counted using the date table filter (you can see these in the previously uploaded picture), however this number should be in the thousands

Thanks

Matt 

Hi @Matt22365 ,

 

So how do you make it appear in the table for the 11 lines?As in my table ,I use a calculated column to link the 2 tables,and everything runs ok,as you can see below:

 

111.png

 

So let me know more details,I will try my best to find out the problem.

 

 
Best Regards,
Kelly

Hi

Thanks for your support

The reason it was only matching 11 entries was due to the Database table "Date Closed" being retrieved in Date/Time format. Once I edited this it all worked.

Thank you for your time helping on this

Matt  

CoreyP
Solution Sage
Solution Sage

Can you share picture of your relationship schema please and thanks

Hi

Thanks for getting back to me I have attached a pictue of my relationships to one of the other comments

The only issue I am having is the highlighted blue line. I want the "Date" Table to filter the "Database" table then a card to count the amount of lines where the date closed matches the filter. e.g. in 2019, how many lines of the database have been closed

Thanks

Matt

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.