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
SophRow
Resolver II
Resolver II

Days since last event

Hi,

 

I have a table that contains a list of site names, participant ID at each site, and the date the participant was randomised into a clinical trial.

 

I want to develop a metric to show for each site the number of days since the most recent randomisation.

 

Example data:

 

SophRow_0-1674347151367.png

 

So in this example I'd want an output of '9 days' for site C, i.e., today minus 13/01/23.

 

Looking for the most efficient way to do this!

 

Thanks 🙂

Soph

1 ACCEPTED SOLUTION
SophRow
Resolver II
Resolver II

I've solved it!

 

If interested I used two measures:

 

Date of Last Randomisation =
CALCULATE ( MAX ( 'Participant Details'[Randomisation Date] ), ALLEXCEPT ( 'Participant Details', 'Participant Details'[Site Name] ) )
 
Days Since Last Randomisation = DATEDIFF('Participant Details'[Date of Last Randomisation],TODAY(),DAY)

View solution in original post

1 REPLY 1
SophRow
Resolver II
Resolver II

I've solved it!

 

If interested I used two measures:

 

Date of Last Randomisation =
CALCULATE ( MAX ( 'Participant Details'[Randomisation Date] ), ALLEXCEPT ( 'Participant Details', 'Participant Details'[Site Name] ) )
 
Days Since Last Randomisation = DATEDIFF('Participant Details'[Date of Last Randomisation],TODAY(),DAY)

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.