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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
zrichardson
Advocate I
Advocate I

First Date in Group

I have a table with branches and File Start Dates. We don't currently have a branch started date in our database so I was going to use the earliest file start date as the branch start date. This would give us a table like so:

 

BranchIDFileStartedDate
11/1/2017
11/3/2017
112/14/2016
211/30/2016
21/31/2017
33/1/2017
31/1/2017
310/1/2016

 

I want to add a Calculated Column:

BranchStartDate = Calculate(Min(Table[FileStartedDate]), Filter(Table, Table[BranchID]=Earlier([BranchID])))

 

This gives me a circular reference error. Is there any formula I can use in a calculated column that would give me this result?

 

BranchIDFileStartedDateBranchStartDate
11/1/201712/14/2016
11/3/201712/14/2016
112/14/201612/14/2016
211/30/201611/30/2016
21/31/201711/30/2016
33/1/201710/1/2016
31/1/201710/1/2016
310/1/201610/1/2016

 

I should probably say that my File Started Date and Branch ID are on 2 different tables with a 1-1 relationship and cross-directional filtering.

 

Thank you!

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @zrichardson,

 

To resolve your issue, you should combine the column [BranchID] and [FileStartedDate] into a single table, as is shown in your original post. If you have had a table contains column [BranchID], please create a calculated column like:

FileStartDate = RELATED(MilestoneDates[FileStartDate])

Then, you can use below DAX formula to display the earliest file start date.

BranchStartDate = Calculate(Min(Table[FileStartedDate]), Filter(Table, Table[BranchID]=Earlier([BranchID])))

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @zrichardson,

 

To resolve your issue, you should combine the column [BranchID] and [FileStartedDate] into a single table, as is shown in your original post. If you have had a table contains column [BranchID], please create a calculated column like:

FileStartDate = RELATED(MilestoneDates[FileStartDate])

Then, you can use below DAX formula to display the earliest file start date.

BranchStartDate = Calculate(Min(Table[FileStartedDate]), Filter(Table, Table[BranchID]=Earlier([BranchID])))

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Phil_Seamark
Microsoft Employee
Microsoft Employee

Could this work?

 

BranchStartDate = Calculate(
               FIRSTDATE('Table'[FileStartedDate]), 
                
                Filter(all('Table'), 'Table'[BranchID]=EARLIER('Table'[BranchID])))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

I tried that, but I am still getting a circular dependency on the file start date.

Hi there, 

 

What are your two tables called and can you please post a small sample set of data showing the data as it is in the two columns.

 

We can definitely join them up for you and produce the results you need.  It's just helpful to see the tables & data as close to your actual structure.

 

🙂


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

2017-02-22 12_38_45-.jpg

 

The Table 'Loans' contains the Branch ID, and 'MilestoneDates' contains Started Date.

 

Started Date is also linked to a calendar table.

Have you considered creating a new table whcih is a merge of the two tables?  Then create your measure on that?

 

This can be done in DAX but might be more efficient to do upstream.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

The two tables are 'Loans' which contains the Branch ID, and MilestoneDates which has the started date. They are Linked with the relationship below.2017-02-22 12_38_45-.png

 

 Started Date is also inactively linked to a calendar table.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.