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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
carinalou
Advocate II
Advocate II

Create measure that returns "in N days" or "N days ago" using inactive relationship to date table

I am trying to create a table visual that shows upcoming due dates of trainings assigned to employees.

 

My fact table of trainings assigned looks like this:

TrainingEmployeeAssigned DateDue DateStart DateCompleted Date
Training 1Employee A

10/1/202

3

10/31/202310/3/202310/3/2023
Training 1Employee B10/1/202310/31/202310/7/202310/12/2023
Training 1Employee C10/1/202310/31/202310/31/2023 
Training 2Employee A10/15/202311/14/202310/16/202310/17/2023
Training 2Employee B10/15/202311/14/202310/19/2023 
Training 2Employee C10/15/202311/14/2023  
Training 3Employee A11/1/202311/30/202311/2/2023 
Training 3Employee B11/1/202311/30/2023  
Training 3Employee C11/1/202311/30/2023  

 

All 4 date fields have a relationship to the date table, with Assigned Date being the active one. Here is the date table:

DateDays From Today
10/1/202338
10/2/202337
10/3/202336
10/4/202335
10/5/202334
10/6/202333
10/7/202332
10/8/202331
10/9/202330
10/10/202329

 

I want to create a table visual that looks like this:

DueTraining% Complete
8 days agoTraining 167%
in 7 daysTraining 233%
in 22 daysTraining 30%

 

How can I write a DAX measure to use the inactive relationship between Due Date and the date table, and return "N days ago" for the past and "in N days" for the future? Thanks in advance!

1 ACCEPTED SOLUTION
barritown
Solution Sage
Solution Sage

Hi @carinalou,

If it is a mandatory thing to use the inactive relationship and the column "Days From Today" then I'd enable filtering in both directions for this inactive relationship and use the measure below.

barritown_0-1699721455688.png

Otherwise, I'd do the same with only the Fact table and DAX TODAY() function.

Please check the attached file for more details.

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

2 REPLIES 2
barritown
Solution Sage
Solution Sage

Hi @carinalou,

If it is a mandatory thing to use the inactive relationship and the column "Days From Today" then I'd enable filtering in both directions for this inactive relationship and use the measure below.

barritown_0-1699721455688.png

Otherwise, I'd do the same with only the Fact table and DAX TODAY() function.

Please check the attached file for more details.

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Thanks for your help!

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.