- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dax Commands with Date vs Days
I am trying to get the Number of Days between two Dates, then if <= 30, I want the Original Amount to show in the New Current Column. If >= 30 AND <=60, then the Original Amount show in the New 31-60 Column. I'm not getting any DAX error using the below info, but it's showing the Original Amount in both Columns. What am I doing wrong? Any help would be appreciated.
- New Current = IF(DATEDIFF([Invoice Date].[Date], [New Date Paid Off].[Date] <= 30, DAY), Exceptions[Original Amount],0)
- New 31-60 = IF(DATEDIFF([Invoice Date].[Day] >= 31, [New Date Paid Off].[Day] <= 60,DAY), Exceptions[Original Amount],0)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ktipton ,
According to your description, here’s my solution.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ktipton ,
According to your description, here’s my solution.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was exactly what I needed. THANK YOU so much!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ktipton
Try these codes to add those columns:
- New Current = IF(DATEDIFF([Invoice Date], [New Date Paid Off], DAY)<=30, Exceptions[Original Amount],0)
- New 31-60 =
Var _DayB = DATEDIFF([Invoice Date], [New Date Paid Off], DAY)
return
IF(_DayB>=31&&_DayB<=60, Exceptions[Original Amount],0)If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ktipton you can simply do this and DAX will comply
but to answer your question
_dateDiffDateDay = DATEDIFF('Table'[Column1].[Date],'Table'[Column2].[Date],DAY)
with this DAX does exacty same as
'Table'[Column2]-'Table'[Column1]
_dateDiffDayDay = DATEDIFF('Table'[Column1].[Day],'Table'[Column2].[Day],DAY)
with thi DAX is only subtracting the DAY part (31-1),(30-1)
pbix is attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the info, but what I'm trying to do is have DAX calculate the DAYS between Invoice Date and New Date Paid off. Once it gets those days, if <= 30, then I want to take the Original Amount and it put it in the New Current Column.
- New Current = IF(DATEDIFF([Invoice Date].[Date], [New Date Paid Off].[Date] <= 30, DAY), Exceptions[Original Amount],0)
For the New 31-60 Column, I want DAX to determine the days between Invoice Date and New Paid Off Date and if GREATER >= 31 and <=60 DAYS, then it would take the Original Amount an add to this new column New 31-60.
- New 31-60 = IF(DATEDIFF([Invoice Date].[Date] >= 31, [New Date Paid Off].[Date] <= 60,DAY), Exceptions[Original Amount],0) OR
- New 31-60 = IF(DATEDIFF([Invoice Date].[Date], Exceptions[New Date Paid Off] >= 31, DAY), IF(DATEDIFF([Invoice Date].[Date], [New Date Paid Off].[Date] <= 60,DAY), Exceptions[Original Amount],0)) - I think I need an AND function in this DAX function.
When I do my DAX queries above, I get the same amount in each aging bucket column, but I was hoping DAX could determine the days between then move the Original Amount into the correct column:

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
06-02-2024 04:30 AM | |||
06-08-2022 07:08 AM | |||
08-28-2024 03:29 PM | |||
12-28-2022 08:03 PM | |||
07-16-2024 02:46 AM |
User | Count |
---|---|
24 | |
13 | |
11 | |
10 | |
9 |
User | Count |
---|---|
18 | |
14 | |
14 | |
12 | |
11 |