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.
I have CarSales with OrderDate and DeliveryDate.
I'm using following to visialize Car DeliveryStatus with pie chart.
I get values like 30% for "Delivery OK", "Delivery Failed"
date diff = datediff(order_date,delivery_date,day)
DeliveryStatus = if([date diff]>30 ,"Delivery OK" ,"Delivery Failed)
Now I would like to add new values pie chart like "Not Delivered Yet",
which happens when OrderDate is not null/Empty and DeliveryDate is Null/Empty.
How to update DAX "DeliveryStatus = if([date diff]>30 ,"Delivery OK" ,"Delivery Failed)"
Solved! Go to Solution.
@Anonymous
Try create a calculated column using this dax:
DeliveryStatus =
VAR Status1 =
IF ( [date diff] > 30, "Delivery OK", "Delivery Failed" )
RETURN
IF ([OrderDate] <> BLANK () && [DeliveryDate] = BLANK (),
"Not Delivered Yet", Status1)
Best,
Paul
@Anonymous
Try create a calculated column using this dax:
DeliveryStatus =
VAR Status1 =
IF ( [date diff] > 30, "Delivery OK", "Delivery Failed" )
RETURN
IF ([OrderDate] <> BLANK () && [DeliveryDate] = BLANK (),
"Not Delivered Yet", Status1)
Best,
Paul
Hi @Anonymous
try
DeliveryStatus =
if(
[date diff]>30 ,"Delivery OK" ,
(if(not(isblank([OrderDate]) && isblank([DeliveryDate])),"Not Delivered Yet","Delivery Failed")
)
do not hesitate to give a kudo to useful posts and mark solutions as solution
I never get "Not Delivered Yet "result to statement if(not(isblank([OrderDate]) && isblank([DeliveryDate])) or isblank([DeliveryDate]) even there are clearly black fields for OrderDate and DeliveryDate.
Does "not(isblank([OrderDate])" work with empty dates?
@Anonymous
try
DeliveryStatus =
if(
[date diff]>30 ,"Delivery OK" ,
(if(not(isblank([OrderDate]) && [OrderDate]<>"" && (isblank([DeliveryDate]) || [DeliveryDate]="")),"Not Delivered Yet","Delivery Failed")
)
do not hesitate to give a kudo to useful posts and mark solutions as solution
DeliveryDate = "" maybe causing issue here.
well, @Anonymous
try to debug isblank.
create two columns
= if(isblank([OrderDate]),1,-1)
= if(isblank([DeliveryDate]),1,-1)
if you can you could share your pbix-file to watch closely
do not hesitate to give a kudo to useful posts and mark solutions as solution
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
27 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |