Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |