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
mitchpj75
Helper I
Helper I

Date diff between 2 columns on 2 different (indirectly) related tables

community.jpg

 

I have 2 indirectly related tables which contain colmns that i wish to calculate the date difference from in days.

 

Table "first_reports_live xxorc_vfn_case_attribute_values" with column "Date allocated to volunteer"

Table "first_reports_live xxorc_vfn_case_attribute_values (2)" with column "Outcome date"

 

I thought it best to use "date diff" to calculate the number of days between the 2 dates (the columns are set as Date type).

The 2 tables are not related directly but are joined via table "first_reports_live xxorc_vfn_reports_cases" in the report.

 

I am using date diff but the tables are not appearing so I cannot reference them for the columns I need to use!  I just want to know how to put the columns into the formula bar correctly so that I can create a new column to the right of the exitsting collumns display the results of the calcualtion.

 

I am creating a measure (the best way?) but the measure doesn't allow me to referecne the tables. Should I be using a quick measure (subtraction option?) to work out the days (only seems to allow for counts)?  if a measure, on which table do I set it up on? Should it be a new column?

 

I was just then going to pull the new measure / new column into the report.

 

Thanks in advance!

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@mitchpj75,

 

Specify an aggregation such as max to get a single result. You may also use RELATED Function to add calculated columns first.

DATEDIFF ( MAX (
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for coming back to me!

 

I have tried the RELATED column approach but the 2 tables in question dont appear in the calculation drop down for me to select?

 

Where is the best place to create the new date diff calculation you mention - on one of the 2 tables I want to use or on the indirectly related table?

 

You mention a calculated column - is it best to create a new column with the calc in or a new measure - just unsure!

 

Thanks!

@mitchpj75,

 

Here is a good article for your reference.

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

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.