Forum Discussion

PowerBeeEye's avatar
PowerBeeEye
Icon for Microsoft Employee rankMicrosoft Employee
6 years ago
Solved

Value in table 1 exist/does not exist in table 2 for each entity

I have 3 tables:

 

Servers

Server_Name 

Server_OS

 

Server_1

     

Windows Server 2016

     

Server_2

     

Windows Server 2019

     

Server_3

     

Windows Server 2016

     

 

 

All Updates

Server_Name 

Patch_ID

 

Server_1

     

KB123

     

Server_1

     

KB456

     

Server_2

     

KB123

     

 

Critical_Patch

OS

 

KB_ID

Windows Server 2016

     

KB456

Windows Server 2019

     

KB789

 

I would like to have the conditional column like so

Servers

Server_Name

 

Server_OS

 

Critical_Patch_Installed

Server_1

 

Windows Server 2016

 

Yes

Server_2

 

Windows Server 2019

 

No

Server_3

 

Windows Server 2016

 

No

 

 

Essentially, For each server in SERVERS,

if list of all KB_IDs in ALL UPDATES for matching [Server_Name] contains mathing [KB_ID] in CRITICAL_PATCH for matching [OS]then [Critical_Patch_Installed] = "yes"

 

 

Really appreciate the help!

  • Fowmy's avatar
    Fowmy
    6 years ago

    PowerBeeEye 

    Please check now:

    You can download the file: HERE

     

    Critical_Patch_Installed = 
    
    VAR _UPDATE = 
    SELECTCOLUMNS(
    FILTER(
    	GENERATE(
    		'CVE-2020-1350',
    		Q_Domain_Controllers_Hotfix_Latest
    	),
    	'CVE-2020-1350'[KBID] = Q_Domain_Controllers_Hotfix_Latest[HotFixID]
    ),
    "_SERVER", Q_Domain_Controllers_Hotfix_Latest[ComputerDNS]
    )
    
    RETURN
    IF( 
        SELECTEDVALUE(Q_Domain_Controllers_Latest[dnshostname]) IN _UPDATE,
        "Yes",
        "No"
    )

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

     



13 Replies

  • PowerBeeEye 

    Please check this solution, I did not create any relationships between Tables.

    Critical_Patch_Installed = 
    
    VAR _UPDATE = 
    SELECTCOLUMNS(
    FILTER(
    	GENERATE(
    		'All Updates',
    		Critical_Patch
    	),
    	'All Updates'[Patch_ID] = Critical_Patch[KB_ID]
    ),
    "_SERVER", 'All Updates'[Server_Name]
    )
    
    RETURN
    IF( 
        SELECTEDVALUE(Servers[Server_OS]) IN _UPDATE,
        "Yes",
        "No"
    )

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

     



    • PowerBeeEye's avatar
      PowerBeeEye
      Icon for Microsoft Employee rankMicrosoft Employee

      Fowmy 

       

      Sorry, but I don't think that worked. Perhaps I made a mitake with the column names, but here are the tables once again:

       

      CVE-2020-1350

      KBIDOS
      KB4565541Windows Server 2012 R2
      KB3000483Windows Server 2016
      KB4558998Windows Server 2019

       

      Q_Domain_Controllers_Latest

      operatingsystemdnshostname
      Windows Server 2016Server1.domain.ext
      Windows Server 2019Server2.domain.ext
      Windows Server 2012 R2Server3.domain.ext

       

      Q_Domain_Controllers_Hotfix_Latest

      HotFixIDComputerDNS
      KB3000483Server1.domain.ext
      KB3003057Server1.domain.ext
      KB3011780Server1.domain.ext
      KB3019978Server2.domain.ext
      KB3023266Server2.domain.ext
      KB3035126Server2.domain.ext
      KB3045685Server3.domain.ext
      KB3045999Server3.domain.ext
      KB4565541Server3.domain.ext

       

      What I'm looking for:

       

      Q_Domain_Controllers_Latest

      operatingsystemdnshostname
      CC_DNSVulnerabilityPatchInstalled
      Windows Server 2016Server1.domain.extYes
      Windows Server 2019Server2.domain.extNo
      Windows Server 2012 R2Server3.domain.extYes

       

       

       

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        PowerBeeEye 

        Please check now:

        You can download the file: HERE

         

        Critical_Patch_Installed = 
        
        VAR _UPDATE = 
        SELECTCOLUMNS(
        FILTER(
        	GENERATE(
        		'CVE-2020-1350',
        		Q_Domain_Controllers_Hotfix_Latest
        	),
        	'CVE-2020-1350'[KBID] = Q_Domain_Controllers_Hotfix_Latest[HotFixID]
        ),
        "_SERVER", Q_Domain_Controllers_Hotfix_Latest[ComputerDNS]
        )
        
        RETURN
        IF( 
            SELECTEDVALUE(Q_Domain_Controllers_Latest[dnshostname]) IN _UPDATE,
            "Yes",
            "No"
        )

        ________________________

        If my answer was helpful, please consider Accept it as the solution to help the other members find it

        Click on the Thumbs-Up icon if you like this reply 🙂

        YouTube  LinkedIn