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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

30,60,90 day filter | Calculate Days Pending Until Due Date

I'm working with a 30,60,90 day filter. I want to calculate days between today and 'Task Next Milestone Due Date'. I tried DATEDIFF but it didn't work in my equation. My equation is below:

 

Days Pending =
CALCULATE (
MAX ( 'Table'[Task Next Milestone Due Date] ),
FILTER (
'Table',
'Table'[Task Next Milestone Due Date]
<= TODAY ()
+ SELECTEDVALUE (
'Days Pending'[Days Pending],
MAX ( 'Days Pending'[Days Pending] )
)
&& 'Table'[Task Next Milestone Due Date] >= TODAY ()
)
)
 
Currently Days Pending shows just the date. As below. How can I display the difference between the due date and today using a similar formula?
 example.PNG
4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Would you please refer to the following measure:

 

 

Days Pending =
VAR _duedate =
    SELECTEDVALUE (
        'Days Pending'[Days Pending],
        MAX ( 'Days Pending'[Days Pending] )
    )
        + MAX ( 'Table'[Date] )
RETURN
    DATEDIFF ( TODAY (), _duedate, DAY )

 

Capture3.PNG

 

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EXPAL7FZtyhIrUpig3P3LroBYtrHtTjQfeK_IxnecEUoNQ?e=gGJjDZ

 

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

 

Best Regards,

Dedmon Dai

 

 

amitchandak
Super User
Super User

@Anonymous ,

Have you tried

a column

datediff(Today(),'Table'[Task Next Milestone Due Date], day())

 

Measure

datediff(Today(),max('Table'[Task Next Milestone Due Date]), day())

Anonymous
Not applicable

Tried this option but it did not work.

Hi @Anonymous ,

 

In your formula , you are calculating MAX('Table'[Task Next Milestone Due Date]) for Days Pending, so the date type of Days Pending would be same as  [Task Next Milestone Due Date], and you already have [Days Pending] in 'Days Pending' table. So what you want to implement with your formula doesn't seem to have anything to do with what you call the measure(or column).

 

Would you please show us some sample data and your expected output or your error with use of datediff? Then we will help you more correctly.

 

Thanks for your understanding and support.

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.