Forum Discussion

king2005r's avatar
king2005r
Icon for Helper III rankHelper III
5 years ago

Vulnerabilities status report monthly (Help)

Dear All,

I hope you have a great day!

 

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

2- Get the count of the new vulnerabilities

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

4- Any vulnerabilities that exist in the last month result to be considered 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

 

 

 

Sample of the output :

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

4 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi king2005r ,

     

    From your description, If you have three tables, you can first append them in power query.

    Then create a column to output last month, next create a measure with swicth(), and finally count by Plugin ID.
    the following formula to create a measure or column :
    First: create a column:

    lastmonth =
    VAR _a = 'Table'[Plugin ID]
    VAR _b = 'Table'[Open Date]
    RETURN
    MAXX ( FILTER ( 'Table', _a = [Plugin ID] && _b > [Open Date] ), [Open Date] )

    Then create a measure:

    Status =
    SWITCH (
    TRUE (),
    MAX ( 'Table'[Open Date] ) = MINX ( ALL ( 'Table' ), [Open Date] ), "Open",
    MONTH ( MAX ( 'Table'[Open Date] ) - MAX ( 'Table'[lastmonth] ) ) = 1, "Open",
    "Close")

    Last count: create a measure:

    Count of Plugin vulnerability = var a= MAX('Table'[Open Date])
    return COUNTROWS(FILTER(ALL('Table'),[Plugin ID]=MAX('Table'[Plugin ID])&&[Open Date]<=a))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • king2005r's avatar
      king2005r
      Icon for Helper III rankHelper III

      Hi v-yalanwu-msft 

       

      Thank you so much, i tried your solutions but all status become closed

      Unfortunately, I expect that the problem is occurring because of that need to compare 2 cloumn (Plugin id, host name ) must be the same for the last month and prevous month (plugin id can be dublicated with other host name, but the host name will be uniq) to be open

       

      lastmonth =
      VAR _a = 'Table'[Plugin ID]
      VAR _b = 'Table'[Open Date]
      RETURN
      MAXX ( FILTER ( 'Table', _a = [Plugin ID] && _b > [Open Date] ), [Open Date] )