The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |