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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Whoule
Helper I
Helper I

Calculate the # of days between a column and today's date

Hello,

 

I am trying to create a new column that returns the numbers of days between an existing column named Assigned On and todays date. Here is my formula: 

= Table.AddColumn(#"Filtered Rows", "Days since assigned", each if #"Request List"[Closed] = "True" then "" else DateTime.LocalNow()-[Assigned On])

 

The problem is the the new colum return ''error'' on each new row. (Expression.Error: A cyclic reference was encountered during evaluation.)

 

Thank you in advance for any help on this issue.

1 ACCEPTED SOLUTION
artemus
Microsoft Employee
Microsoft Employee

The issue is probably related to #"Request List"[Closed], which depending on what that is may be the source of the cyclic reference. Are you sure it shouldn't just be [Closed]?

 

Also:

1. You want the [Closed] = "True" to be null, not "".

2. Change DateTime.LocalNow()-[Assigned On] to (DateTime.LocalNow()-[Assigned On]) / #duration(1, 0, 0, 0)

   This will change the value to number of days.

View solution in original post

1 REPLY 1
artemus
Microsoft Employee
Microsoft Employee

The issue is probably related to #"Request List"[Closed], which depending on what that is may be the source of the cyclic reference. Are you sure it shouldn't just be [Closed]?

 

Also:

1. You want the [Closed] = "True" to be null, not "".

2. Change DateTime.LocalNow()-[Assigned On] to (DateTime.LocalNow()-[Assigned On]) / #duration(1, 0, 0, 0)

   This will change the value to number of days.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors