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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Syndicate_Admin
Administrator
Administrator

Consulta entre 2 tablas.

Hola a todos,

Tengo 2 tablas como esta,

NithinBN_0-1698083824344.pngNithinBN_1-1698083842205.png

Quiero enumerar el recuento distinto de ID, cuando su, Col-A = 1 y (los valores de Corsponding Col-B en otra tabla no son H),

Aquí, en este ejemplo, quiero contar 103, 104, 106 y 104 y devolver 4 como valor (rechazando 100, 101, 105 como 500 y 508 tiene valor H)

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@NithinBN ,

Probablemente comenzaría con una columna calculada en la primera tabla:

tackytechtom_0-1698094937074.png

ColLvlLookup = 
CALCULATE ( MAX(Table2[lvl]), FILTER ( Table2, Table1[col-B] = Table2[Col-B] ) ) 

Y luego puedes agregar una medida:

tackytechtom_1-1698095008644.png

Measure = 
VAR _helpTable =
SUMMARIZE ( 
    FILTER ( Table1, Table1[ColLvlLookup] = "H" ),
    Table1[ID]
)
RETURN
CALCULATE ( DISTINCTCOUNT ( Table1[ID] ), Table1[col-A] = 1, NOT Table1[ID] IN (_helpTable) )

¡Espero que esto ayude! 🙂

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors