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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PierreCA
Resolver I
Resolver I

Filter Min (date) on two conditions in another column

I want to get the last date of an Open demand of a table on two conditions: 
1. The Situation  is Open

2. The Situation  is not Solved

 

With those conditions,

I should see the demand no. 2 and the date 2022-10-04

I should not see the demand no1 and the date 2022-01-01, as it is solved. 

 

IDF_iD_DemandDateSituation
112022-10-01Open
212022-10-02Assess
312022-10-03Solved
422022-10-04Open
52 2022-10-06Assess

 

I guess there's a a double filter somewhere  but don't know where. 

1 ACCEPTED SOLUTION

But if Demand no 1 isn't solved and no 2 is, you'd get the same answer. which is not right. 

Finally, the best solution I found is the following:

Calculate (
          Min ( table}[datefield]),
          table[Situation]=Open, 
         NOT (table[Situation]=Open && table[Situation]=Solved))
          )


Thanks @lbendlin  🙂 

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

Power Query or DAX ?

Dax. 🙂

Here's a measure.  Frankly, this could have been a calculated column too.

 

lbendlin_0-1716473230302.png

Open Date = if("Solved" in VALUES('Table'[Situation]),BLANK(),minx(filter('Table',[Situation]="Open"),[Date]))

But if Demand no 1 isn't solved and no 2 is, you'd get the same answer. which is not right. 

Finally, the best solution I found is the following:

Calculate (
          Min ( table}[datefield]),
          table[Situation]=Open, 
         NOT (table[Situation]=Open && table[Situation]=Solved))
          )


Thanks @lbendlin  🙂 

NOT (table[Situation]=Open && table[Situation]=Solved)

This makes no sense as it always evaluates to TRUE  (and it's missing the double quotes)

@lbendlin , 🙂

It makes sens, since I want to discard  demands solved from the result. The only way to identify them is by that conditions. Otherwise, the program will take only a look if Situtation is Open. That's the case to all demands at the beginning and report the date of the wrong demand.

 

No, you need to rewrite it.

 

NOT table[Situation] IN {"Open","Solved"}

Hello @lbendlin ,  🙂

I've try your proposition and, unformtunately, it failed. 

The question is then why? 

I believe that's because your proposition evaluate Situation is either Open or Solved.  And because the program always find at least an Open, is neutralise the precedent condition.  As a result = Blank. 

In mine, I do evaluate if a demand is not Open and Solved. I only want to keep a demand Open only. That's why, with  solution I will not return demand no 1, as it's both Open and Close; but return no 2, as it is only Open.

Thanks for your insightful.  




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors