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 fairly new using PBI and Dax/Power Querys and has got stuck in a problem with a calculation . This is what I want to achive:
As you can see in picture below are there three columns, two of those handle order and delivery date. These two are just dates, no calculation. Column "C" should present days between order and delivery. I´ve managed to measure these days if both order and delivery date are filled in with this DAX-code: Days between order and delivery = ('TableName'[order date] - 'TableName'[delivery date])*1,
But here is the twist I mentioned in the subject line.
- I want days to continue counting, and also be presented, even if delivery hasn´t been completed. Calculation(or measure) should use current day as input(e.g TODAY() in Dax). Look at example in row 3.
I´ve tried this code with no luck...
if ["delivery date"]=""
then (DateTime.Date-["order date"])
else
(["delivery date"]-["order date"])
Thanks for help in advance!
Have you posted this twice (it would be helpful if you remove the other post)
In DAX
Column = DATEDIFF(TableL[Delivery date] , if (ISBLANK(TableL[Order date]), TODAY(), TableL[Order date]), DAY)
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |