Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm a rookie stuck on this one, and after searching around for a little while thought I'd ask the community for help.
I have created a custom column to work out the difference in days between a Due Date and Today's date. The calc I've used is:
"Due Date Difference", each Duration.Days(DateTime.Date(DateTimeZone.UtcNow()) - [Due Date]
The results are good, but I want to inverse their +/- so that any due date before the current date is a negative number (overdue) and a future due date is a positive number (coming up due). Current results show anything due after today's date as negative number, with anything before today's date is positive.
Tried playing around with a few things that resulted in errors. Saw that multiplying the column by -1 would inverse the numbers but having a problem figuring out whether I can do this in the calc above or do I need another column/formula to do this?
Any assistance appreciated.
Paul
Solved! Go to Solution.
Hey @peegee68,
this formula
Duration.Days(DateTime.Date(DateTimeZone.UtcNow()) - [Due Date]) * -1
is inversing the values:
As you can see the future due date is positive, future, from today's perspective:
From a performance point of view, I recommend calculating the difference and inversing the result in a single formula.
Hopefully, this provides what you are looking for.
Regards,
Tom
Thanks very much for the simple solution. I did play around with this but must have had the syntax incorrect or something otherwise in the wrong place???
Hey @peegee68,
this formula
Duration.Days(DateTime.Date(DateTimeZone.UtcNow()) - [Due Date]) * -1
is inversing the values:
As you can see the future due date is positive, future, from today's perspective:
From a performance point of view, I recommend calculating the difference and inversing the result in a single formula.
Hopefully, this provides what you are looking for.
Regards,
Tom
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |