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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help required on Aging and duration in power bi dax

Hi Team,

 

I need to calculate duration and aging based on the dates selected from the slicer Dateslicer (we used option as Between)

We are having fields like startdate and enddate columns in the source table.

 

Requirement

 

Slicer : 

Slicer.png

 

Duration in Days Calculation

For example: We are having

Startdate                 Enddate

01-Jan-2024         10-Jan-2024

 

We need to calculate duration for above record is  diffference between these two dates :01-jan-2024 & 08-jan-2024 because we selected enddate as 8-jan-2024 from the slicer 

 

Always StartDate>=Selected date from slicer

Enddate should be : <= selected date from the slicer

 

Power bI File LinkAgingDuration.pbix

 

Thanks,

Deva.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-kongfan-msft ,

 

Requirement was resolved by myself. Thanks for your message.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

Can't open the pbix file you shared, please re-share it in another way and I'll get back to you as soon as possible.

 

Best Regards,
Adamk Kong

Anonymous
Not applicable

Hi @v-kongfan-msft ,

 

Requirement was resolved by myself. Thanks for your message.

lbendlin
Super User
Super User

You can let the data model help you, with USERELATIONSHIP

 

lbendlin_0-1705276229687.png

 

What's your formula for aging?

Anonymous
Not applicable

Hi @lbendlin ,

 

I've created relation in data model and created measure for duration. 

 We are using matrix visual to show the data . Duration is showing correctly in the detail level( last drill down level) while we drill up to above level duration showing wrong values(means its not summing up the data)

 

For example:

 

Deatil Level

These duration values(Highloghted in yellow) are calculating correctly

 

Detail.png

 

Drill Up Level

 

When we drill up the data showing wrong value )highlighted yellow)

we need to show : sum of 4.94+1.11

 

Drillup.png

 

I tried in my way but unable to solve the issue . Can you please help on the same?

Measure name created in the attached file is: Duration_Day

 

Power file Link:  AgingDuration.pbix

 

Thanks,

Deva.

Your slicer should be fed by a proper calendar table, not by 

DISTINCT(Sheet1[StartDate])

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.