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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Columna calculada condicional con agrupaciones

Hola a todos, todavía soy nuevo en DAX y tengo una situación aquí que he estado buscando para resolver durante unos días.

Tengo una tabla a continuación y estoy tratando de poblar Account_Status. La lógica es básicamente si el Unique_ID es el mismo (grupo) y si cualquier campo de Product_Subscription es 'Activo' para este grupo, Account_Status debe ser Activo. ¿Cómo obtengo este tipo de salida?

¡Gracias de antemano!

Unique_IDProductoProduct_SubscriptionAccount_Status
100P1ActivoActivo
100P1InactivoActivo
100P2InactivoActivo
100P3ActivoActivo
200P1InactivoActivo
200P2ActivoActivo
200P3InactivoActivo
200P3ActivoActivo
200P3ActivoActivo
300P2InactivoInactivo
300P2InactivoInactivo

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hola @khantk2501 ,

Por favor, intente así:

Account_Status =
VAR CountActive =
    CALCULATE (
        COUNTROWS( 'Table' ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Unique_ID] ),
            'Table'[Product_Subscription] = "Active"
        )
    )
RETURN
    IF ( CountActive > 0, "Active", "Inactive" )

2.PNG

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

¡Muchas gracias! Esto funcionó 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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