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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

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.

2 REPLIES 2
amitchandak
Super User
Super User

You should try earlier or lookup

 

https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469

https://community.powerbi.com/t5/Desktop/Getting-the-sum-of-the-previous-datetime-value-in-report/td...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, 

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?

https://ahso365-my.sharepoint.com/:f:/g/personal/denisha_malone_ahs_com/EkA3jy-oMMtBsrEK2guyMGEBQ0O7...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.