Forum Discussion

Sonnet's avatar
Sonnet
Helper I
2 years ago

Using countx with three conditions

Hi everyone, I have a table of risks and the calendar table. I need to calculate the number of risks that were open in a certain period, where their status is high and the date closed should be within 14 days from the date opened, if more than 14 days, then the risk is non compliant.

I have used the following measure but I am getting blank values:

 

Non Compliant Vulnerabilities = CALCULATE( COUNTX(FILTER('Web Vulnerabilities', 'Web Vulnerabilities'[Date Opened]<= MAX('Calendar'[Date]) && 'Web Vulnerabilities'[Risk Description] = "high" && 'Web Vulnerabilities'[Date Closed] > DATEADD('Web Vulnerabilities'[Date Opened],+14,DAY)),'Web Vulnerabilities'[Title]),CROSSFILTER('Web Vulnerabilities'[Date Opened],'Calendar'[Date],None))
 
Any suggestions?

1 Reply

  • Everything seems to be correct. But I cannot understand this why use CROSSFILTER?

     

    Also, since MAX(Calendar[date]) is used, did you check if the max date points to some future date where there might not be vulnerabilities?

     

    If you can share a sample data pbix file, it would be helpful to look at.