cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Feilin Regular Visitor
Regular Visitor

Dynamic date table from UNION and with relationships not working

I have a dynamic date table, which uses the date from two tables, by using:

DISTINCT(
    UNION(
        DISTINCT(
            Table1[Date].[Date]);
        DISTINCT(
            Table2[Date].[Date])))

Then I do some calculations (bring out the years/months/quarters/days/etc). Now, when I try to connect this table to either of the original two (by dragging it in the relationships tab), it goes blank because the original field doesn't retrieve any data (i.e. has no rows in it, it would seem). How do I get around this?

 

Also, it may not be the best idea to use the formula above to create the date table, so feel free to suggest/link better solutions (although that is not the critical issue, unless it is part of the problem, of course).

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dynamic date table from UNION and with relationships not working

You could get around it by using ALL but I would just use CALENDARAUTO.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Dynamic date table from UNION and with relationships not working

You could get around it by using ALL but I would just use CALENDARAUTO.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Feilin Regular Visitor
Regular Visitor

Re: Dynamic date table from UNION and with relationships not working

Yeah, that seems to do the trick; thanks!

Anonymous
Not applicable

Re: Dynamic date table from UNION and with relationships not working

Just used with Unique Identifiers from 2 tables that refresh weekly.
Replaced date fields in code with the Unique Identifier column.

DISTINCT(
    UNION(
        DISTINCT(
            Table1[UniqueIdentifier]);
        DISTINCT(
            Table2[UniqueIdentifier])))


Worked like a charm!
Thanks Smiley Happy

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 394 members 3,559 guests
Please welcome our newest community members: