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
hakimissimo
Regular Visitor

Comparing two dates from different tables

Hello,

 

Very beginner with PowerBI, i'm trying to compare two dates to determine some elapse time.

 

two tables : incidents and incident-sla

 

The tables have a relationship based on incident number (Number).

 


What i tryed with add a new column : Column = DATEDIFF(Incidents[Opened];'Incident-sla'[start time];DAY)

 

 

but i have the error : a single value for column 'start time' in table incident-sla cannot be determined....

 


Any help appreciated 🙂

 

 

++

 

 

 


 

 

2 ACCEPTED SOLUTIONS

upload to onedrive and include a link



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

Hi @hakimissimo,

 

I have fixed your Calc for you and uploaded a new file to the share you created.

 

Steps:

- Change relationship direction from 'both' to 'single'

- updated the formula to the following, which returns the max('incident-sla'[Start time]) where the 'incident-sla'[Number] = 'Incidents'[Number].

 

 

BeforeAck = CALCULATE(max('incident-sla'[Start time]), FILTER('incident-sla', 'incident-sla'[Number] = 'Incidents'[Number]))

- Add a Table visual that show how the max value is returned for each rown in the header and detail tables

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

11 REPLIES 11

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.