Forum Discussion
looking for a calculated column
- 6 years ago
Anonymous
please try below DAX
status = VAR failnum = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[type]=Table1[type]&&'Table'[status]="fail")) return if(failnum>0,"Fail","pass") - 6 years ago
Anonymous
I think it always display pass because I only calculate fail times.
You can try below measure
status = VAR failnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[status]="fail")) VAR passnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[status]="pass")) return if(failnum=0&&passnum=0,blank(),if(failnum>0,"Fail","pass"))bean also shows blank because its name in your anothe table is beans and I also add a test type for testing.
Hope this is helpful.
Anonymous
I think it always display pass because I only calculate fail times.
You can try below measure
status =
VAR failnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[status]="fail"))
VAR passnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[status]="pass"))
return if(failnum=0&&passnum=0,blank(),if(failnum>0,"Fail","pass"))bean also shows blank because its name in your anothe table is beans and I also add a test type for testing.
Hope this is helpful.
i have another scenario that if value >90 display 'pass' and if value >80 dispaly 'average' and value less than 80 red' for type fruit from above table.
i tried below but didn't work
status2 =
VAR failnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[value]>90)
VAR avgnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[value] >80 && 'TEST'[value] <89 )
VAR passnum = CALCULATE(COUNTROWS('TEST'),FILTER('TEST','TEST'[type]='Table'[type]&&'TEST'[value]<80)
return if(failnum=0&&passnum=0,"Average",if(failnum>0,"Fail","pass"))