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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MorePowerBI
Helper II
Helper II

Date Table and Fact Table one-to-many relationship displaying blanks despite same data type

Hi all,

 

I have _DateTable with the date column [Date Table] that's connected one-to-many with date columns from two other tables.

MorePowerBI_0-1622003117611.png

 

When I plot data using APP_Z_RECEIVING and _DateTable everything works as expected. However when I plot data from APP_Z_RI_TURNAROUND and _DateTable, I get blanks.

MorePowerBI_0-1622039059925.png

 

 

The data type is date for all three tables so I know this isn't the issue. Help is greatly appreciated!

UPDATE 6/1/2021:

Per @KNP 's investigation

There's something not right with the TXN_IN_DATE type. If you convert that date to epoch, like so...

 

Epoch = DATEDIFF(DATE(1970,1,1), APPS_Z_RI_TURNAROUND_TIME_REPORT_STG_GG[TXN_IN_DATE], SECOND)

 

it gives accuracy that includes hours, minutes seconds.

If you add the same 'Epoch' column to the date table, it does not.

 

Epoch = DATEDIFF(DATE(1970,1,1), _DateTable[Date Table], SECOND)

 

Date table for 1/24/2020 = 1579824000

Your fact table 1/24/2020 = 1579874507

 

Still looking to get some assistance with this. Is there a way I can align the epoch times?

1 ACCEPTED SOLUTION
KNP
Super User
Super User

I would start by going back to Power Query and look at this transform...

  #"Changed Type" = Table.TransformColumnTypes(APPS_Z_RI_TURNAROUND_TIME_REPORT_STG_GG1,{{"TXN_IN_DATE", type date}}),

 

Maybe try adding a new column, date only from TXN_IN_DATE.

 

KNP_0-1622582571979.png

 

and then see if that column behaves as expected.

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

View solution in original post

13 REPLIES 13
KNP
Super User
Super User

I would start by going back to Power Query and look at this transform...

  #"Changed Type" = Table.TransformColumnTypes(APPS_Z_RI_TURNAROUND_TIME_REPORT_STG_GG1,{{"TXN_IN_DATE", type date}}),

 

Maybe try adding a new column, date only from TXN_IN_DATE.

 

KNP_0-1622582571979.png

 

and then see if that column behaves as expected.

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Appreciate the response!

I previously tried transforming the TXN_IN_DATE column to date only but the extract date step would not complete/render so I gave up on that avenue; didn't occur to add a new date only column based on the TXN_IN_DATE column.

 

Doing this and then creating a relationship between the date table and this new dat column solved the issue.

KNP
Super User
Super User

@MorePowerBI - it appears your date table doesn't go back far enough. Starts at 19/01/2021, it needs to go back further. 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

No, my date table starts 500 days ago.

MorePowerBI_1-1622575489401.png

 

 

Sorry, I meant to say 2020. (edit: I'm only seeing 1/19/2020)

 

KNP_0-1622575784322.png

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

that's not the visual i'm having issues with.

I'm having issues with this table:

MorePowerBI_0-1622576695556.png

 

There's something not right with the TXN_IN_DATE type. If you convert that date to epoch, like so...

 

Epoch = DATEDIFF(DATE(1970,1,1), APPS_Z_RI_TURNAROUND_TIME_REPORT_STG_GG[TXN_IN_DATE], SECOND)

 

it gives accuracy that includes hours, minutes seconds.

 

If you add the same 'Epoch' column to the date table, it does not.

 

Epoch = DATEDIFF(DATE(1970,1,1), _DateTable[Date Table], SECOND)

 

Date table for 1/24/2020 = 1579824000

Your fact table 1/24/2020 = 1579874507

 

I hope this helps you to debug further.

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

I see what you mean now. That is weird. I even created a new date table and joined to TXN_IN_DATE but it suffers from the same issue. 

I'll let you know if I think of something but I currently have no idea as the types and join looks sound.

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
Icey
Community Support
Community Support

Hi @MorePowerBI ,

 

I can't reproduce your issue. Please re-check if the relationships are created correctly.

manage relationships.PNG

 

In addition, it will be better if you can share us a sample file with the same issue. Please remove sensitive information and real data.

 

Reference: How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MorePowerBI
Helper II
Helper II

Bumping this up for visibility

amitchandak
Super User
Super User

@MorePowerBI , This means dates are missing in date table.

or your date in fact have timestamp and you need to create a date without the time and join that

 

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

no that didn't solve it. I don't believe I have a timestamp in the APPS_Z_RI_TURNAROUND table. Under query editor it shows as data type date and doesn't have any time stamps. I actually change the data type in a step.

MorePowerBI_0-1622045184749.png

 

I know the data type in the date table is also correct:

MorePowerBI_1-1622045276252.png

 

I'm also not missing any dates as you can tell from the second image in my original post.

 

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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