Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I'm trying to find out the Aging of a case wcich registered in our system. In my dataset I have 2 date feilds. Assigned Date, and Completed Date.
I have created a calculated column by subtracting Assigned Date from Completed Date, I got the difference between and converted that value to Whole number so I can see how many days it took to complete it. But My problem is for some case there will be no Completed date so it wont give me exact how many days it is still there without complete.
So I want if there is no Completed Date then need calculate between Assigned Date to Todays date. And If Completed Date is available then calculate between Assigned Date and Completed Date.
Can someone help me.
Thnak You.
Solved! Go to Solution.
@EbyEaso OK, so:
= if 'SQL-DATE-UPDATED'[CompletedDate] = null then DateTime.LocalNow() - 'SQL-DATA-UPDATED'[AssignedToDate] else 'SQL-DATE-UPDATED'[CompletedDate] - 'SQL-DATA-UPDATED'[AssignedToDate]
@EbyEaso Should be able to create an if statement that if the [Completed Date] = null then use DateTime.LocalNow in your calculation.
@Greg_Deckler Thank You. Appreciaet it.
My current calculation is this.
@EbyEaso OK, so:
= if 'SQL-DATE-UPDATED'[CompletedDate] = null then DateTime.LocalNow() - 'SQL-DATA-UPDATED'[AssignedToDate] else 'SQL-DATE-UPDATED'[CompletedDate] - 'SQL-DATA-UPDATED'[AssignedToDate]
It gives Syntax Error.
I put my actual query name.
@EbyEaso Dude, you posted in the Power Query forum but it looks like you are trying to put Power Query code into a DAX calculated column. In DAX, that would be:
IF('SQL-DATE-UPDATED'[CompletedDate] = BLANK(), DATEDIFF(TODAY(),'SQL-DATA-UPDATED'[AssignedToDate],DAY), DATEDIFF('SQL-DATE-UPDATED'[CompletedDate], 'SQL-DATA-UPDATED'[AssignedToDate]))
Sorry @Greg_Deckler
I'm beginner. 🙂 Trying to get solve these.
in DAX also i got error.
And in Power Query I got this.
@Greg_Deckler
Finaly I got it. My Assigned To Date was in date time format. I think that was the issue. I changed that Date only format and added additional column to show todays date. Instead of using this
DateTime.LocalNow()
Now its fine.
Thank You @Greg_Deckler for the valuable support. Appreciate it.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |