Forum Discussion
Calculating remediated vulnerabilities
- 7 years ago
hi tvm_analyst
you could try something like this:new table = ADDCOLUMNS ( SUMMARIZE ( 'finding_date', 'finding_date'[asset_id], 'finding_date'[vulnerability_id] ), "firstFoundDate", CALCULATE ( MIN ( 'finding_date'[date] ) ),
"lastFoundDate", CALCULATE ( Max ( 'finding_date'[date] ) ) )then, assuming that asset_id and vulnerability_id is unique in the finding-table, create a new column in the new table
isSolvedFlag = IF ( ISBLANK ( LOOKUPVALUE ( 'finding'[date], 'finding'[asset_id], 'new table'[asset_id], 'finding'[vulnerability_id], 'new table'[vulnerability_id] ) ), 1, 0 )and then you should be on you way
hi tvm_analyst
you could try something like this:
new table =
ADDCOLUMNS (
SUMMARIZE (
'finding_date',
'finding_date'[asset_id],
'finding_date'[vulnerability_id]
),
"firstFoundDate", CALCULATE ( MIN ( 'finding_date'[date] ) ),
"lastFoundDate", CALCULATE ( Max ( 'finding_date'[date] ) )
)then, assuming that asset_id and vulnerability_id is unique in the finding-table, create a new column in the new table
isSolvedFlag =
IF (
ISBLANK (
LOOKUPVALUE (
'finding'[date],
'finding'[asset_id], 'new table'[asset_id],
'finding'[vulnerability_id], 'new table'[vulnerability_id]
)
),
1,
0
)and then you should be on you way
- tvm_analyst7 years agoFrequent Visitor
Thank you for the response sturlaws ! However this would assign the min date found in the entire table to all the vulnerabilities. I would like to do something like a GROUPBY(unique_key) and find the MIN/MAX value within each group... if that makes sense.
- sturlaws7 years agoResident Rockstar
tvm_analyst, since you have not made any sample data available, I don't know excatly how your data looks, so the code should be consider more as guidelines for you to continue working on to get your desired result
- sturlaws7 years agoResident Rockstar
if you care to upload some sample data I will take a look at it :)