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

Can't connect order table to calendar table

A bizarre situation today. I cannot seem to connect my Orders table to my calendar table. I want to start building out Revenue totals (monthly, MTD, YTD, YoY%) so I built a Calendar table, connected it to my preferred date column within my Orders table (Created Date) and start building measures and visualizations and nothing. 

I've attached my pbix here and you can see that I have "Year" as my rows and Revenue (my measure) as my value and it's just a blank matrix. 

Can someone please take a look and tell me where I went wrong. I'm sure this is an easy fix but I'm spinning my wheels.

 

LINK

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@seanpratt 

It's because you have the time included in your [Created Date] so the relationship is not finding any matching rows in your Calendar table.

2020-06-22_13-31-32.png

Remove the Time from the field and it should work for you.

You could remove it a couple ways.

 

CREATED DATE = 
COALESCE (
    DATE ( 
        YEAR ( ORDERS[ORIGINAL ORDER CREATED DATE] ), 
        MONTH ( ORDERS[ORIGINAL ORDER CREATED DATE] ), 
        DAY ( ORDERS[ORIGINAL ORDER CREATED DATE] ) 
    ),
    DATE ( 
        YEAR ( ORDERS[CREATED TIME] ), 
        MONTH ( ORDERS[CREATED TIME] ), 
        DAY ( ORDERS[CREATED TIME] ) 
    )
)

 

or

 

CREATED DATE = 
COALESCE (
    INT ( [ORIGINAL ORDER CREATED DATE] ),
    INT ( ORDERS[CREATED TIME] )
)

If you use the INT approach you will have the change the data type back to date.

 

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @seanpratt 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly. thanks!

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
jdbuchanan71
Super User
Super User

@seanpratt 

It's because you have the time included in your [Created Date] so the relationship is not finding any matching rows in your Calendar table.

2020-06-22_13-31-32.png

Remove the Time from the field and it should work for you.

You could remove it a couple ways.

 

CREATED DATE = 
COALESCE (
    DATE ( 
        YEAR ( ORDERS[ORIGINAL ORDER CREATED DATE] ), 
        MONTH ( ORDERS[ORIGINAL ORDER CREATED DATE] ), 
        DAY ( ORDERS[ORIGINAL ORDER CREATED DATE] ) 
    ),
    DATE ( 
        YEAR ( ORDERS[CREATED TIME] ), 
        MONTH ( ORDERS[CREATED TIME] ), 
        DAY ( ORDERS[CREATED TIME] ) 
    )
)

 

or

 

CREATED DATE = 
COALESCE (
    INT ( [ORIGINAL ORDER CREATED DATE] ),
    INT ( ORDERS[CREATED TIME] )
)

If you use the INT approach you will have the change the data type back to date.

 

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.