Forum Discussion
Retrieve only one rows with two status
- 5 years ago
Anonymous
Create the following measure and add this measure and the Job Name in a table or matrix visuals:Final Status = var __t = CALCULATETABLE( Table1 , ALLEXCEPT( Table1 , Table1[JobName] )) return SWITCH( TRUE(), CONTAINS(__t,Table1[Status],"Fail") , "Fail", CONTAINS(__t,Table1[Status],"Running") , "Running", "Sucess" )
Hi, Anonymous
Please check the below picture and the sample pbix file's link down below.
It is for creating a measure.
Status Last step number measure =
VAR currentdate =
MAX ( 'Table'[Date] )
VAR currentjobname =
MAX ( 'Table'[JobName] )
VAR laststepnumber =
CALCULATE (
MAX ( 'Table'[Step Number] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] = currentdate
&& 'Table'[JobName] = currentjobname
)
)
RETURN
IF (
ISFILTERED ( 'Table'[JobName] ),
CALCULATE (
MAX ( 'Table'[Status] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] = currentdate
&& 'Table'[JobName] = currentjobname
&& 'Table'[Step Number] = laststepnumber
)
)
)
https://www.dropbox.com/s/o45li1conjvsrjk/shahabh.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM