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

Mostrar recuentos de diferente estado (existe en diferentes columnas) como un objeto visual jerárquico

¡Hola!

Estoy tratando de mostrar los recuentos de diferentes estatuys de los iDE en un árbol jerárquico visual, pero estoy enfrentando problemas en los recuentos que sólo suman . Básicamente los datos se ven algo así como a continuación:

IdEstado1Estado2Estado3Estado4Estado5Estado6
1YYY
2Y
3YYYY
4YYYYYY
5YY
6YYYY
7YYY
8YYYYYY

Lo que quiero mostrar es un árbol con un recuento único total de identificadores, eliminado propio a diferentes recuentos de estado y que se va a desglosar en cada identificación.

Si alguien ha hecho esto y tiene ideas a su alrededor sería muy apreciado.

Gracias

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hola

Por favor, siga estos pasos:

1)Despivote todas las columnas de estado.

2)Crear una tabla por Introducir datos como se indica a continuación:

10.PNG

3)Pruebe esta medida:

Count_of_each_id = 
IF (
    ISINSCOPE ( 'Level'[Lev8] ),
    CALCULATE (
        COUNT ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[ID] = 8 && 'Table'[Value] = "Y" )
    ),
    IF (
        ISINSCOPE ( 'Level'[Lev7] ),
        CALCULATE (
            COUNT ( 'Table'[Value] ),
            FILTER ( 'Table', 'Table'[ID] = 7 && 'Table'[Value] = "Y" )
        ),
        IF (
            ISINSCOPE ( 'Level'[Lev6] ),
            CALCULATE (
                COUNT ( 'Table'[Value] ),
                FILTER ( 'Table', 'Table'[ID] = 6 && 'Table'[Value] = "Y" )
            ),
            IF (
                ISINSCOPE ( 'Level'[Lev5] ),
                CALCULATE (
                    COUNT ( 'Table'[Value] ),
                    FILTER ( 'Table', 'Table'[ID] = 5 && 'Table'[Value] = "Y" )
                ),
                IF (
                    ISINSCOPE ( 'Level'[Lev4] ),
                    CALCULATE (
                        COUNT ( 'Table'[Value] ),
                        FILTER ( 'Table', 'Table'[ID] = 4 && 'Table'[Value] = "Y" )
                    ),
                    IF (
                        ISINSCOPE ( 'Level'[Lev3] ),
                        CALCULATE (
                            COUNT ( 'Table'[Value] ),
                            FILTER ( 'Table', 'Table'[ID] = 3 && 'Table'[Value] = "Y" )
                        ),
                        IF (
                            ISINSCOPE ( 'Level'[Lev2] ),
                            CALCULATE (
                                COUNT ( 'Table'[Value] ),
                                FILTER ( 'Table', 'Table'[ID] = 2 && 'Table'[Value] = "Y" )
                            ),
                            IF (
                                ISINSCOPE ( 'Level'[Lev1] ),
                                CALCULATE (
                                    COUNT ( 'Table'[Value] ),
                                    FILTER ( 'Table', 'Table'[ID] = 1 && 'Table'[Value] = "Y" )
                                ),
                                CALCULATE ( COUNT ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Value] = "Y" ) )
                            )
                        )
                    )
                )
            )
        )
    )
)

4)El resultado muestra:

11.PNG

Aquí está mi archivo pbix de prueba:

pbix

Espero que esto ayude.

Saludos

Giotto

Greg_Deckler
Super User
Super User

Por lo tanto, generalmente desajustaría todas esas columnas de estado en Power Query y, a continuación, las cosas suelen volverse triviales.

Si ese no es el caso, por favor vea este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ 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...

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.

Top Kudoed Authors