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
Anonymous
Not applicable

Circular Dependency when calculating Max date column which is a lookup value from another table

Hi!

I am getting a circular dependency error when do a earliest date column based on the Date colimn whihc i brought as a Lookup value from another tab;e. Really appreciate if someone has encountered such issue and have a solution.

 

Table 1                                        Table 2

ID        Date                               Tag         ID          Date(Vlookup from Table 1)     Earliest Date

1        2020-03-02                      A            1           2020-03-02                             Should be - 2020-01-01

2        2019-07-6                        A            3           2020-01-01                             Should Be - 2020-01-01

3        2020-01-01  

 

Following is my logic:

Earliest Date = CALCULATE (
    MINX (
         SUMMARIZE (
            'Table 2',
            'Table 2'[Tag ID],
            "minimumdate", min('Table 2'[Date])
        ),
        [minimumdate]
    )
)
 
Thanks

 

Now I want to create a new column for the Earliest Date in Table 2 Based on Tag ID.

When I try doing so I get a circular dependency error                  

1 ACCEPTED SOLUTION

@Anonymous here is the dax expression to add new column to get the earliest date

 

Earliest Date = CALCULATE ( MIN ( TableDate[Date] ), ALLEXCEPT ( TableDate, TableDate[Tag Id] ) ) 

 

Would appreciate Kudos 🙂 if my solution helped.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous in your example dataset there is no column called Tag ID, can you please edit your post and clarify it.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi Parry2K!

 

This is what I am expecting to show in the Earliest Date column:Example

Tag ID             ID            Date(This is a Lookup value from Table 1)       Earliest Date Based on TagID(Expected Result)
IPP-18-17       abc123            Blank                                                             2020-10-15
IPP-18-17       abc123       2020-10-31                                                   2020-10-15
IPP-18-17       xyz123        2020-10-25                                                   2020-10-15
IPP-18-17       def345       2020-10-15                                                   2020-10-15
IPP-18-17       abc123      2020-10-17                                                   2020-10-15
IPP-18-17       abc123      2020-11-16                                                   2020-10-15
IPP-18-17      def345        2020-11-12                                                  2020-10-15
IPP-18-17      xyz123        2020-11-09                                                  2020-10-15
IPP-18-17      abc123        2020-11-27                                                  2020-10-15

@Anonymous so I guess you have one to many relationships from table 1, correct? You can use relation function to get the date from table1 instead of using lookupvalue function.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@Anonymous here is the dax expression to add new column to get the earliest date

 

Earliest Date = CALCULATE ( MIN ( TableDate[Date] ), ALLEXCEPT ( TableDate, TableDate[Tag Id] ) ) 

 

Would appreciate Kudos 🙂 if my solution helped.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Sorry about that , the Tag column on the Table 2 is the Tag ID.

Table 1                                        Table 2

ID        Date                               Tag ID         ID          Date(Vlookup from Table 1)     Earliest Date

1        2020-03-02                      A            1           2020-03-02                             Should be - 2020-01-01

2        2019-07-6                        A            3           2020-01-01                             Should Be - 2020-01-01

3        2020-01-01  

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.