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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
king2005r
Helper III
Helper III

Vulnerabilities closed report monthly or yearly

Hi

I have a table with monthly vulnerabilities, Plugin ID, and Host IP, I need to do the below measurement  :

1- Any vulnerabilities don't exist in the last scan month vulnerabilities consider as closed in all previous months 

2- Any vulnerabilities exist in the last scan month consider as open in all previous months

 

Example table : 

Aug/2020

Plugin IDHostOpen Date
1026311.22.33.1161/Aug/2020
1038612.33.44.231/Aug/2020

Sep/2020

Plugin IDHostOpen Date
1026311.22.33.1161/Sep/2020
1038912.33.44.231/Sep/2020

 

Oct/2020

Plugin IDHostOpen Date
1024411.22.33.661/Oct/2020
1034712.33.44.231/Oct/2020

 

 

I expect something like the below table :

Plugin IDHostOpen DateRepeatedStatusCount of Plugin vulnerabilityToday
1026311.22.33.1161-Aug-20Not repeatedOpen11-Jan-21
1038612.33.44.231-Aug-20Not repeatedOpen11-Jan-21
1026311.22.33.1161-Sep-20repeatedOpen21-Jan-21
1038912.33.44.231-Sep-20Not repeatedClosed11-Jan-21
1024411.22.33.661-Oct-20Not repeatedClosed11-Jan-21
1034712.33.44.231-Oct-20Not repeatedClosed11-Jan-21
1024411.22.33.661-Nov-20repeatedClosed21-Jan-21
1034712.33.44.231-Nov-20repeatedClosed21-Jan-21
1026311.22.33.1161-Dec-20repeatedopen31-Jan-21
1038612.33.44.231-Dec-20repeatedopen21-Jan-21
1026311.22.33.1161-Jan-21repeatedopen41-Jan-21
1038612.33.44.231-Jan-21repeatedopen31-Jan-21
1 ACCEPTED SOLUTION

Hi @king2005r ,

 

Please try :

 

Status = IF(CALCULATE(MAX('Table'[Repeated]),FILTER('Table','Table'[Plugin ID] = EARLIER('Table'[Plugin ID])&&'Table'[Open Date] = 'Table'[Today]&&'Table'[Host] = EARLIER('Table'[Host]))) = "repeated","Open","Closed")

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

13 REPLIES 13
v-deddai1-msft
Community Support
Community Support

Hi @king2005r ,

 

Is there any update?

 

Best Regards,

Dedmon Dai

Hi @v-deddai1-msft 

 

Thank you very much for your interest and follow-up. Really appreciated

Unfortunately when I tried it on the actual data, the formula is good, but there are some errors that appear during the current month as closed with the current month, and I could not know the reason
But it is so far the best formula that has been used
thank you very much

v-deddai1-msft
Community Support
Community Support

Hi @king2005r ,

 

I am not getting you very well. Would you please show us the expected output based on your sample data?

 

Best Regards,

Dedmon Dai

Hi @v-deddai1-msft 

issue related to duplicated Plugin ID if there duplication, but can be solved by adding other condeation

Can I add one condeation to your fourmla :

'Table'[Host] = 'Table'[Host]

 

Hi @king2005r ,

 

Please try :

 

Status = IF(CALCULATE(MAX('Table'[Repeated]),FILTER('Table','Table'[Plugin ID] = EARLIER('Table'[Plugin ID])&&'Table'[Open Date] = 'Table'[Today]&&'Table'[Host] = EARLIER('Table'[Host]))) = "repeated","Open","Closed")

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

v-deddai1-msft
Community Support
Community Support

Hi @king2005r ,

 

Would you please try to use the following calculated column:

 

Status = IF(CALCULATE(MAX('Table'[Repeated]),FILTER('Table','Table'[Plugin ID] = EARLIER('Table'[Plugin ID])&&'Table'[Open Date] = 'Table'[Today])) = "repeated","Open","Closed")

 

Capture.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

Hi @v-deddai1-msft 

Thanks you for your reply, but unfortunately all status become close, and in your example there error not applying the same wanted rule 😞

 

1- Any vulnerabilities don't exist in the last month scan (Today) vulnerabilities consider as closed status in all previous months

2- Any vulnerabilities are exist in the last month scan (Today) consider as open in all previous months

amitchandak
Super User
Super User

@king2005r , I am assuming this data is appended or or you can append in power Query, This will very similar my blog , https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...

 

Retained and New are Open and Lost is closed

Example of your case

	Rec = countrows(Table)
	MTD = calculate([Rec],datesmtd('Date'[Date]))
	LMTD = calculate([Rec],DATESMTD(DATEADD('Date'[Date],-1,MONTH)))	
	Closed = if(ISBLANK([MTD]) && not(ISBLANK([LMTD])) , "Closed","Open")

 

This need plot like you have shown

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Unfortunately i tried and it did not work

@king2005r , Create a measure like

Measure = if( ISBLANK(CALCULATE(COUNT('Table'[Plugin ID]), FILTER(ALLSELECTED('Table'), 'Table'[Open Date] ='Table'[Today] && 'Table'[Plugin ID] =MAX('Table'[Plugin ID]) ))), "Closed","Open")
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak  

Unfortunately all resoult become Closed even for current month

AllisonKennedy
Super User
Super User

@king2005r  Why do you only have one closed? I can't see 10244 (and many others) in the last month so shouldn't that be closed? 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Yes, you are correct, kindly find the below updated sample 

Plugin IDHostOpen DateRepeatedStatusCount of Plugin vulnerabilityToday
1026311.22.33.1161-Aug-20Not repeatedOpen11-Jan-21
1038612.33.44.231-Aug-20Not repeatedOpen11-Jan-21
1026311.22.33.1161-Sep-20repeatedOpen21-Jan-21
1038912.33.44.231-Sep-20Not repeatedClosed11-Jan-21
1024411.22.33.661-Oct-20Not repeatedClosed11-Jan-21
1034712.33.44.231-Oct-20Not repeatedClosed11-Jan-21
1024411.22.33.661-Nov-20repeatedClosed21-Jan-21
1034712.33.44.231-Nov-20repeatedClosed21-Jan-21
1026311.22.33.1161-Dec-20repeatedopen31-Jan-21
1038612.33.44.231-Dec-20repeatedopen21-Jan-21
1026311.22.33.1161-Jan-21repeatedopen41-Jan-21
1038612.33.44.231-Jan-21repeatedopen31-Jan-21

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors