Forum Discussion
CJ_96601
7 years agoHelper V
Tag a record
Can someone help me on how to tag a record in power bi query using filter. Ex: count records if order date <= calendar and delivery date is > calendar - tag the record late delivery and so on...
- 7 years ago
Hi CJ_96601 ,
There is a problem. If you' like a column in Power Query, you have to assign the date to use. In other words, you can't make it dynamic. Since you need a column, there could be two solutions.
1. A calculated column with DAX.
test = IF ( 'sales'[order date] <= TODAY () && 'sales'[delivery date] > TODAY (), "Late Delivery", "Normal" )2. A new column with Power Query.
if [order date] <= DateTime.LocalNow() and [delivery Date] > DateTime.LocalNow()
then "Late Delivery"
else "Normal"Best Regards,
CJ_96601
7 years agoHelper V
Hi, thanks, but it is not the solution i am looking for.
I need the tag in additional column, in power query
regards,
v-jiascu-msft
7 years agoMicrosoft Employee
Hi CJ_96601 ,
There is a problem. If you' like a column in Power Query, you have to assign the date to use. In other words, you can't make it dynamic. Since you need a column, there could be two solutions.
1. A calculated column with DAX.
test =
IF (
'sales'[order date] <= TODAY ()
&& 'sales'[delivery date] > TODAY (),
"Late Delivery",
"Normal"
)
2. A new column with Power Query.
if [order date] <= DateTime.LocalNow() and [delivery Date] > DateTime.LocalNow()
then "Late Delivery"
else "Normal"
Best Regards,
- CJ_966017 years agoHelper V
Thanks.