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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.