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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX para mostrar las filas cuando tenemos el estado es sólo "Verdadero"

Hola, tengo una tabla como abajo donde tenemos 3 columnas pero para algunas personas en Nombre tiene el estado Verdadero y Falso. Sin embargo, hay personas que su estatus es sólo True. Ahora quiero escribir un DAX para mostrar quiénes son esas personas que tienen el estado es sólo Verdadero y otro Dax para mostrar quiénes son las personas que tienen tanto el estado.

¿Puede alguien ayudarme con esto, por favor?

PaísNombreEstado
IndiaAmitVerdad
IndiaAmitFalso
E.e.u.uJohnVerdad
E.e.u.uJohnFalso
UkChrisVerdad
UkChrisFalso
IndiaSureshVerdad
IndiaNareshVerdad
UkherreroVerdad
E.e.u.uAshishVerdad
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hola @akhil_PBI ,

Dependiendo de lo que necesite, puede hacer una medida como la siguiente:

Only true =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table'[Name]; 'Table'[Status] );
            'Table'[Name];
            "@count"; COUNTA ( 'Table'[Status] )
        );
        [@count] = 1
    )
)

Both States = 
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table'[Name]; 'Table'[Status] );
            'Table'[Name];
            "@count"; COUNTA ( 'Table'[Status] )
        );
        [@count] = 2
    )
)

Compruebe la conexión del archivo PBIX.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hola @akhil_PBI ,

Dependiendo de lo que necesite, puede hacer una medida como la siguiente:

Only true =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table'[Name]; 'Table'[Status] );
            'Table'[Name];
            "@count"; COUNTA ( 'Table'[Status] )
        );
        [@count] = 1
    )
)

Both States = 
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table'[Name]; 'Table'[Status] );
            'Table'[Name];
            "@count"; COUNTA ( 'Table'[Status] )
        );
        [@count] = 2
    )
)

Compruebe la conexión del archivo PBIX.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Gracias @MFelix - ¡Funciona!

Greg_Deckler
Super User
Super User

@akhil_PBI - Usted debe ser capaz de utilizar EXCEPT y INTERSECT. Por ejemplo, algo como esto:

Measure 2 = 
    VAR __Name = MAX('Table (2)'[Name])
    VAR __True = SELECTCOLUMNS(FILTER('Table (2)',[Status]=TRUE()),"Name",[Name])
    VAR __False = SELECTCOLUMNS(FILTER('Table (2)',[Status]=FALSE()),"Name",[Name])
    VAR __Names = SELECTCOLUMNS(EXCEPT(__True,__False),"Name",[Name])
RETURN
    IF(__Name IN __Names,1,BLANK())

Tenga en cuenta que este es un ejemplo de un selector complejo: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/td-p/1116633


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hola @Greg_Deckler, Gracias por su respuesta. Pero, me estoy quedando en blanco.

@akhil_PBI - Odd, ¿pusiste esa medida en una tabla junto con la columna Nombre?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

¡Sí! Así es.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.