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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Min Date with Conditions

Hello,

Hope everyone is having a nice day.

 

Would someone be able to help me with a DAX formula please?

I would like the DAX formula to do 2 things:

1. Calculate the Min Open Date if

          1. Status is not Void

          2. Type is Accepted

2. Then count the number of Min Open Date greater or equal to 3

Kryssy_0-1678027683713.png

Would anyone be able to help me please?

Thanks

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

please try

=
SUMX (
VALUES ( 'Table'[Name] ),
VAR CurrentNameTable =
CALCULATETABLE ( 'Table' )
VAR FilteredTable =
FILTER (
CurrentNameTable,
'Table'[Status] = "Open"
&& 'Table'[Type] = "Accepted"
)
VAR StartDate =
MAXX ( CurrentNameTable, 'Table'[Start Date] )
VAR OpenDate =
MINX ( FilteredTable, 'Table'[Open Date] )
RETURN
IF ( DATEDIFF ( StartDate, OpenDate, DAY ) > 3, 1 )
)

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Anonymous 

please try

=
SUMX (
VALUES ( 'Table'[Name] ),
VAR CurrentNameTable =
CALCULATETABLE ( 'Table' )
VAR FilteredTable =
FILTER (
CurrentNameTable,
'Table'[Status] = "Open"
&& 'Table'[Type] = "Accepted"
)
VAR StartDate =
MAXX ( CurrentNameTable, 'Table'[Start Date] )
VAR OpenDate =
MINX ( FilteredTable, 'Table'[Open Date] )
RETURN
IF ( DATEDIFF ( StartDate, OpenDate, DAY ) > 3, 1 )
)

Anonymous
Not applicable

THNAK YOU @tamerj1  !

FreemanZ
Super User
Super User

hi @Anonymous 

what do you mean by "count the number of Min Open Date greater or equal to 3", could you elaborate it?

Anonymous
Not applicable

Hi @FreemanZ,
Sorry about that, find the # of days between Start Date and Min Open Date and if its Greater or equal to 3 then count the number of names.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors