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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Date Formula

Hello!

 

I am trying to figure out a formula but I can't seem to get it right.

 

I have two tables that have two different types of calls. One is showing Hardware Calls and the other is showing our In House Providers calls. Both tables have a Store Number, Call Date, and a Completion Date.

 

I want the formula to say if the Hardware Call Date< ( is before) In House provider Completion Date and the Hardware Completion Date> (is after) in house provider Completion Date, return the number 1.

 

I am trying to find out how many times the in house provider would have been able to complete hardware calls at that particular store (missed opportunity). The struggle I am running into is that these are in two different tables, the common value would be the store number in both tables. Everything I try to do this I get the error code saying there are multiple values where a single value is expected. Any help would be appreciated! Thanks!

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

1.png

First as the error message show, please make sure the data type of both of your two dates columns which are used to compare are date type.

 

In addition, if you want to use 'AND' condition in the if statement, it should be '&&' instead of '&', '&' is used to combine two columns.

 

Best Regards,
Community Support Team _ Yingjie Li
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

5 REPLIES 5
vanessafvg
Community Champion
Community Champion

are you able to share what code you have written?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Capture.JPG

Hi @Anonymous ,

1.png

First as the error message show, please make sure the data type of both of your two dates columns which are used to compare are date type.

 

In addition, if you want to use 'AND' condition in the if statement, it should be '&&' instead of '&', '&' is used to combine two columns.

 

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

Anonymous
Not applicable

I made those changes and I am just getting blanks now. Is there another way to write this? I feel like crossing tables is ruining this. The Service Crew has been to all of these stores multiple times, but I only want it to return the date if it was in between the Hanging Hardware Call Date and Completion Date.

Hi @Anonymous ,

Since the columns are come from two different tables, you neeed to create measures by the previous modified formula and use a table visual in the report to show the result instead of creating a calculated column directly.

 

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.