Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
natasha_antosha
Frequent Visitor

From Dax to M Create a Custom Column

Hi,

 

I am trying to filter the table and detect the shipments that have not been scanned for more than 3 hours from start time to now. For that I would like to create a custom column, that would mark those shipments as not scanned, my dax for that would look like this: 

Not Scanned =
IF(
    DATEDIFF(
                MIN('Work [START_TIME]),
                NOW(),
        HOUR
    ) >= 3
    && NOT ISBLANK(MIN('Work '[START_TIME])),
    1,
    0

 

What m code should I Use to create that kind of column in my table? Thank you!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

DateTime.LocalNow() - [Start_Time]??DateTime.LocalNow() >= #duration(0,3,0,0)

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

DateTime.LocalNow() - [Start_Time]??DateTime.LocalNow() >= #duration(0,3,0,0)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.