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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sonnet
Helper I
Helper I

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 1
govindarajan_d
Super User
Super User

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. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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