This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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
thanks
Solved! Go to Solution.
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,
Hi @CJ_96601 ,
If you'd like to show them in a report, please try out this measure.
test = IF ( MIN ( 'sales'[order date] ) <= TODAY () && MIN ( 'sales'[delivery date] ) > TODAY (), "Late Delivery", "Normal" )
Best Regards,
Hi, thanks.
Instead of today, i need to have a variable date, in filter.
Regards,
Obet
Hi Obet,
You can try this one in that case.
test = VAR selectedDate = IF ( ISBLANK ( SELECTEDVALUE ( 'Calendar'[Date] ) ), TODAY (), SELECTEDVALUE ( 'Calendar'[Date] ) ) RETURN IF ( MIN ( 'sales'[order date] ) <= selectedDate && MIN ( 'sales'[delivery date] ) > selectedDate, "Late Delivery", "Normal" )
Best Regards,
Thanks. can i use power query or measure?
Hi @CJ_96601 ,
Could you please mark the proper answers as solutions?
Best Regards,
Hi, thanks, but it is not the solution i am looking for.
I need the tag in additional column, in power query
regards,
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,
Thanks.
My pleasure. It's a measure.
Best Regards,
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 29 | |
| 23 | |
| 22 |