Showing results for 
Search instead for 
Did you mean: 
ahspowerbi Frequent Visitor
Frequent Visitor

Conditinal Column Using DAX

Hi Community, 


I have a data model that has multiple Dispatch ID's. The table populates with statuses for the IDs and when a new status is entered, it does not overide the previous one:


Dispatch ID | Status Code | dispatch timestamp  | Last Modified           |  Touched Flagged 

2341              20                 9/1/2019 15:00:00        9/3/2019 14:01:00

2341              12                 9/1/2019 15:00:00        9/4/2019 11:08:00

2121              13                 9/3/2019 18:00:00        9/4/2019 1:01:00

2341              10                 9/1/2019 12:00:00        9/5/2019 10:01:00       

1124              13                 9/8/2019 15:00:00        9/3/2019 14:01:00

2121              12                 9/3/2019 15:00:00        9/5/2019 14:00:00


I am wanting to create a flagged column to give me a flag if the Status happen within a certain amount of time. The condition is:

Id Dispatch ID has Status of 10 or 20 within 5 hours (last modified - dispatch timestamp), then flagged column should read "Touched"). This flag should reman as a flag for that ID regardless of the current status after it has met this condition.

ahspowerbi Frequent Visitor
Frequent Visitor

Re: Conditinal Column Using DAX


I am now wanting to sum any values, rather create a conditional flag based on earliest (or current) row.
As I start the IF Statement with Earliest I am unable to add the column value. Any help?


I have attached the test .pbix I am using to determine the appropriate DAX. Can you please take a look and assist?

Helpful resources

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 112 members 1,517 guests
Please welcome our newest community members: