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
Feilin
Helper II
Helper II

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
Greg_Deckler
Super User
Super User

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


@ 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...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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 🙂

Greg_Deckler
Super User
Super User

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


@ 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...

Yeah, that seems to do the trick; thanks!

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.