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

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

Reply
D_Brandon_E
Regular Visitor

DatesBetween when both dates are connected to Date table but none are primary

Hi everyone,

 

I am working on a project and the datasource I am receiving to work with is not the best but I do not have any control over it. I have a table in which there are around 10-15 seperate date columns for different milestones in a project. One of the dates marks that the particular site project has started and another date column marks the completion of the site project. All dates in this table are connected to the Date table. Both date columns can be BLANK by design as the project has not yet started or is not complete. 

 

I am trying to create a calculated column showing the days to completion of the projects. When I perform a simple DATESBETWEEN function, I keep getting the "A table of multiple values was supplied...." message. 


The function I have written so far with errors is:

Average Time = DATESBETWEEN('Date'[Date], 'Table'[Start Date], 'Table[Finish Date])

 

I even tried to create variables to weed out the projects that have a BLANK is either or both of the date fields. I have tried several iterations to try and get it to not throw an error. I verified that both fields have the same data type (Date). Neither of these fields are the primary connection to the date table. I tried various runs at using "USERELATIONSHIP" but those failed as well.

 

Any thoughts?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @D_Brandon_E ,

 

DATEBETWEEN function will return a table that contains a column of dates that begins with a specified start date and continues until a specified end date. So you will get this error "A table of multiple values was supplied...."  in your calculated table. I suggest you to try DATEDIFF function.

Complete Datediff = 
IF (
    'Table'[Status] = "Completed",
    DATEDIFF ( 'Table'[StartDate], 'Table'[EndDate], DAY ),
    BLANK ()
)

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
aj1973
Community Champion
Community Champion

Hi @D_Brandon_E 

Can you provide a Sample please!

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

@aj1973 

 

Sample:

 

IDStatusStartDateMilestone1Milestone2EndDate
1Completed1/3/20211/17/20213/7/20215/18/2021
2Not Started    
3Milestone14/17/20216/22/2021  
4Completed4/18/20215/9/20219/8/202110/2/2021
5Milestone26/7/20219/6/202110/27/2021 

 

I need to calculate the days between in a calculated column of StartDate and EndDate if Status is Completed. Both StartDate and EndDate are connected to the date table but are not primary. (Original Data set has around 15 date columns and another column is the primary. 

Anonymous
Not applicable

Hi @D_Brandon_E ,

 

DATEBETWEEN function will return a table that contains a column of dates that begins with a specified start date and continues until a specified end date. So you will get this error "A table of multiple values was supplied...."  in your calculated table. I suggest you to try DATEDIFF function.

Complete Datediff = 
IF (
    'Table'[Status] = "Completed",
    DATEDIFF ( 'Table'[StartDate], 'Table'[EndDate], DAY ),
    BLANK ()
)

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.