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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
zkeller
Frequent Visitor

Dynamic Ageing Calculation with Date Table and Inactive Relationships

I've been doing a lot of searching and I can't find any solutions that are working for me...

 

Two simplify my situation I have two tables, a FACT table and a date table, with the inactive relatioships shown below:

 

FACT Table

1. Case Number

2. Case Opened Date (Inactive Relationship 1)

3. Case Closed Date (Inactive Relationship 2)

 

Date Table

1. Date (Inactive Relationship 1/2)

 

I need to calculate the difference between the Case Opened Date and the Date to arrive at a Case Age.  It would be easy enough if the Date was always today's date, but I want the user to be able to filter the report on a given date and see what the age of that case would have been on that date.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @zkeller ,

 

You might consider using Date Table as a slicer, and using the datediff() function to return the interval between two dates, e.g. year, month, day, etc.

DATEDIFF function (DAX) - DAX | Microsoft Learn

Create measure:

Day_Measure =
var _select=SELECTEDVALUE('Date Table'[Date])
return
DATEDIFF(
    MAX('FACT Table'[Case Opened Date]),_select,DAY)
Year_Measure =
var _select=SELECTEDVALUE('Date Table'[Date])
return
DATEDIFF(
    MAX('FACT Table'[Case Opened Date]),_select,YEAR)

vyangliumsft_0-1718069389882.png

If the above doesn't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @zkeller ,

 

You might consider using Date Table as a slicer, and using the datediff() function to return the interval between two dates, e.g. year, month, day, etc.

DATEDIFF function (DAX) - DAX | Microsoft Learn

Create measure:

Day_Measure =
var _select=SELECTEDVALUE('Date Table'[Date])
return
DATEDIFF(
    MAX('FACT Table'[Case Opened Date]),_select,DAY)
Year_Measure =
var _select=SELECTEDVALUE('Date Table'[Date])
return
DATEDIFF(
    MAX('FACT Table'[Case Opened Date]),_select,YEAR)

vyangliumsft_0-1718069389882.png

If the above doesn't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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