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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PowerBeeEye
Employee
Employee

El valor de la tabla 1 existe/no existe en la tabla 2 para cada entidad

Tengo 3 tablas:

Servidores

Nombre_de_servidor

Server_OS

Server_1

Windows Server 2016

Server_2

Windows Server 2019

Server_3

Windows Server 2016

Todas las actualizaciones

Nombre_de_servidor

Patch_ID

Server_1

KB123

Server_1

KB456

Server_2

KB123

Critical_Patch

el

KB_ID

Windows Server 2016

KB456

Windows Server 2019

KB789

Me gustaría tener la columna condicional así

Servidores

Nombre_de_servidor

Server_OS

Critical_Patch_Installed

Server_1

Windows Server 2016

Server_2

Windows Server 2019

No

Server_3

Windows Server 2016

No

Esencialmente, para cada servidor en SERVIDORES,

si la lista de todas las KB_IDs en TODAS LAS ACTUALIZACIONES para la coincidencia [Server_Name] contiene matemáticas [KB_ID] en CRITICAL_PATCH para la coincidencia de [OS], entonces [Critical_Patch_Installed] á "sí"

Realmente apreciar la ayuda!

1 ACCEPTED SOLUTION

@PowerBeeEye

Por favor, compruebe ahora:

Puede descargar el archivo: 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"
)

Fowmy_0-1599166168189.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

13 REPLIES 13
Fowmy
Super User
Super User

@PowerBeeEye

Por favor, compruebe esta solución, no he creado ninguna relación entre tablas.

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"
)

Fowmy_0-1599160264668.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy

Lo siento, pero no creo que haya funcionado. Tal vez hice un mitake con los nombres de columna, pero aquí están las tablas una vez más:

CVE-2020-1350

KBIDel
KB4565541Windows Server 2012 R2
KB3000483Windows Server 2016
KB4558998Windows Server 2019

Q_Domain_Controllers_Latest

sistema operativodnshostname
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

Lo que estoy buscando:

Q_Domain_Controllers_Latest

sistema operativodnshostname
CC_DNSVulnerabilityPatchInstalled
Windows Server 2016Server1.domain.ext
Windows Server 2019Server2.domain.extNo
Windows Server 2012 R2Server3.domain.ext

Hola @PowerBeeEye ,

Puede crear una medida como se indica a continuación:

CC_DNSVulnerabilityPatchInstalled =
VAR _patches =
    CONCATENATEX (
        FILTER (
            ALLSELECTED ( 'Q_Domain_Controllers_Hotfix_Latest' ),
            'Q_Domain_Controllers_Hotfix_Latest'[ComputerDNS]
                = MAX ( 'Q_Domain_Controllers_Latest'[dnshostname] )
        ),
        'Q_Domain_Controllers_Hotfix_Latest'[HotFixID],
        ","
    )
VAR _npatches =
    SUBSTITUTE ( _patches, ",", "" )
VAR _index =
    ROUND ( LEN ( _npatches ) / 9, 0 ) - 1
VAR mytable =
    ADDCOLUMNS (
        GENERATESERIES ( 0, _index ),
        "mylist",
             (
                MID ( _npatches, [Value] * 9 + 1, 9 )
            )
    )
VAR mylist =
    SELECTCOLUMNS ( mytable, "list", [mylist] )
VAR _a =
    CALCULATE (
        DISTINCTCOUNT ( 'CVE-2020-1350'[KBID] ),
        FILTER (
            ALLSELECTED ( 'CVE-2020-1350' ),
            'CVE-2020-1350'[KBID] IN mylist
                && 'CVE-2020-1350'[OS] = MAX ( 'Q_Domain_Controllers_Latest'[operatingsystem] )
        )
    )
RETURN
    IF ( _a > 0, "Yes", "No" )

Value in table 1 exist does not exist in table 2 for each entity.JPG

Saludos

Rena

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

gracias @yingyinr

Un problema sin embargo - la columna 'CVE-2020-1350'[OS] no contiene valores únicos:

KBIDel
KB4565524Windows Server 2008 R2
KB4565539Windows Server 2008 R2
KB4565537Windows Server 2012
KB4565535Windows Server 2012
KB4565541Windows Server 2012 R2
KB4565540Windows Server 2012 R2
KB4565511Windows Server 2016
KB4558998Windows Server 2019
KB4559003Windows Server 2019

Hola @PowerBeeEye ,

Por favor, intente establecer la cardinalidad de la relación entre la tabla CVE-2020-1350 y la tabla Q_Domain_Controllers_Latest como Muchos a Uno y compruebe si la medida "CC_DNSVulnerabilityPatchInstalled" todavía funciona bien. Cualquier preocupación o problema por favor no dude en hacerme saber.

relationship.JPG

Saludos

Rena

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

@yingyinr

Desafortunadamente, eso no funcionaría ya que ninguna de las columnas solo tiene valores únicos; tanto el

OperaciónSistema en la tabla Q_Domain_Controllers_Latest y

La columna del sistema operativo de la tabla CVE-2020-1350 tiene valores repetidos.

Aquí está una lista de valores únicos:

  • CVE-2020-1350 [KBID]
  • Q_Domain_Controllers_Latest [dnshostname]

Hola @PowerBeeEye ,

Aquí compartiré mi archivo pbix de muestra con usted. ¿Podría por favor ayudar a comprobar si me perdí alguna información que causó la medida no puede funcionar bien en su lado ? Gracias. Sobre el problema de los valores duplicados de la columna OperatingSystem en Q_Domain_Controllers_Latest tabla y la columna del sistema operativo en la tabla CVE-2020-1350, la cardinalidad de la relación entre ellos se ha establecido como Muchos en muchos en mi sampleix pb fie.

Saludos

Rena

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

@yingyinr

Hola, ¿probaste mi solución?

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy Creo que lo tengo funcionando - Estoy verificando la salida.

Una pregunta: ¿cómo puedo usar la medida en un visualizador? Me gustaría mostrar cuántos servidores tienen "sí" y cuántos tienen "no".

@PowerBeeEye

Puede descargar el archivo: HERE


Para visualizar el recuento basado en YES/NO, cree una tabla utilizando la opción introducir datos:

Fowmy_0-1600156325097.png

Agregue esta medida:

Path Installs = 
COUNTROWS(
    FILTER(
        Q_Domain_Controllers_Latest ,
        [Critical_Patch_Installed] = SELECTEDVALUE('Path Installed'[Path Installed Status])
    )    
)


Muéstralo en un gráfico de columnas o en cualquier otro objeto visual adecuado que prefieras.

Fowmy_1-1600156438234.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin






Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

muchas gracias, @Fowmy esto parece que funciona muy bien!

@yingyinr Desafortunadamente, no puedo seleccionar una relación de muchos a muchos, ya que estoy usando Power BI Desktop optimizado para Reporting Server y tengo la intención de guardarla en el servidor de informes.

Mis únicas opciones son *:1, 1:1 y 1:*

¿Cómo podemos solucionar esto?

@PowerBeeEye

Por favor, compruebe ahora:

Puede descargar el archivo: 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"
)

Fowmy_0-1599166168189.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors