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

Conde del conde

Hola a todos

Estoy tratando de conseguir un conteo de cuenta.

Datos de muestra:

PERSON_IDUSE_ID
1333
1444
1555
2666
2777
3888
4999
51111
52222
53333
54444

En este momento estoy contando el número de 'USE_ID' para cada PERSON_ID', por lo que

  • PERSON_ID 1 tiene un recuento de 3 USE_ID,
  • PERSON_ID 2 tiene un recuento de 2 USE_ID
  • PERSON_ID 3 tiene un recuento de 1 USE_ID
  • PERSON_ID 4 tiene un recuento de 1 USE_ID
  • PERSON_ID 5 tiene una cuenta de 4 USE_ID

Estoy tratando de hacer una medida que me muestre el conteo de estos recuentos, por ejemplo:

1 PERSON_ID con 4 USE_ID,

1 PERSON_ID con 3 USE_ID,

1 PERSON_ID con 2 USE_ID,

2 PERSON_ID con 1 USE_ID.

La lógica se utilizaría entonces idealmente para que pueda tener:

Total de PERSON_ID con 1 USE_ID, 2-3 USE_ID, 4-5 USE_ID, 6-9 USE_ID, 10+ USE_ID.

¡Gracias!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@dwidrascuBG

tal vez usted puede tratar de crear una nueva mesa

table2 = SUMMARIZE('Table','Table'[PERSON_ID],"count",count('Table'[USE_ID]))

haga clic derecho en la columna personID y seleccione count

1.PNG





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Icey
Community Support
Community Support

Hola @dwidrascuBG ,

Prueba esto:

1. Crear una medida: Recuento de 'USE_ID' para cada PERSON_ID'.

Count of 'USE_ID' for each PERSON_ID' = COUNT('Table'[USE_ID])

count1.PNG

2. Cree una tabla.

Num of count of USE_ID = 
SUMMARIZE (
    GENERATESERIES (
        1,
        MAXX ( VALUES ( 'Table'[PERSON_ID] ), [Count of 'USE_ID' for each PERSON_ID'] ),
        1
    ),
    [Value],
    "No. of USE_ID", [Value] & " USE_ID"
)

num.PNG

3. Crear una medida: Recuento de PERSON_ID con n USE_ID.

Count of PERSON_ID with n USE_ID = 
VAR t =
    ADDCOLUMNS (
        'Table',
        "count1", CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[PERSON_ID] ) )
    )
VAR t2 =
    ADDCOLUMNS (
        t,
        "count2", CALCULATE (
            DISTINCTCOUNT ( 'Table'[PERSON_ID] ),
            FILTER ( t, [count1] = MAX ( 'Num of count of USE_ID'[Value] ) )
        )
    )
RETURN
    IF (
        HASONEVALUE ( 'Num of count of USE_ID'[No. of USE_ID] ),
        MAXX ( t2, [count2] ),
        DISTINCTCOUNT ( 'Table'[PERSON_ID] )
    )

count2.PNG

BTW, archivo .pbix adjunto.

Saludos

Icey

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

ryan_mayu
Super User
Super User

@dwidrascuBG

tal vez usted puede tratar de crear una nueva mesa

table2 = SUMMARIZE('Table','Table'[PERSON_ID],"count",count('Table'[USE_ID]))

haga clic derecho en la columna personID y seleccione count

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

@amitchandak Esto me resulta muy difícil de entender después de leer todos los artículos.

Todos parecen estar relacionados con el valor dentro de la columna y no un recuento de ese valor que aparece junto a otra columna, como en mi publicación inicial.

Por favor, ¿puede explicar qué artículo de los múltiples artículos se aplica a mi ejemplo, y cómo?

dwidrascuBG_0-1597678378924.png

Aquí está mi visualización con el conteo de USE_ID contra el PERSON_ID. Quiero agruparlos, pero cuando hago clic con el botón derecho, el grupo no se puede seleccionar y está atenuado.

Por favor, ¿puede haber más ayuda aquí? El novillo anterior es insuficiente, por desgracia después de leer los artículos todavía no entiendo del todo.

Gracias.

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.