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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ngct1112
Post Patron
Post Patron

Cómo contar el recuento distinto de una columna

Hola a todos, me gustaría contar cuántas veces el valor distintivo de "Producto">1. ¿Alguien podría aconsejar cómo agregar esta medida? En este caso, Producto A, B, C, estos 3 productos se producen más de 1, por lo que la anwer debe ser 3

IdProducto
1A
2B
3C
4A
5A
6B
7D
8E
9F
10C
3 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Quizás:

Measure =
  VAR __Table = 
    SUMMARIZE(
      'Table',
      [Product],
      "__Count",COUNTROWS('Table')
    )
RETURN
  COUNTROWS(FILTER(__Table,[__Count]>1))


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hola

Escribir estas medidas

Total price = SUM(Data[Net Price])
Measure = SUMX(FILTER(SUMMARIZE(VALUES(Data[Product]),Data[Product],"ABCD",COUNTROWS(Data),"EFGH",[Total price]),[ABCD]>1),[EFGH])

Arrastre la segunda medida al objeto visual. El resultado será 130.

Espero que esto ayude.


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

View solution in original post

Hola

Escriba esta medida

Medidas: SUMX(FILTER(SUMMARIZE(VALUES('Table1'[Product]),'Table1'[Product],"ABCD",CALCULATE(COUNTROWS('Table1'),Table1[Net Price]>0),"EFGH",[Total price]),[ABCD]>1&&[EFGH]<>BLANK()),[EFGH]))))))))))))))))))).)).)))))))))))))))))))))))))))))))))))))))))))))))/[ABCD]>1&&[EFGH]<>BLANK()),[EFGH]))))))))))))))))))________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Espero que esto ayude.


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

View solution in original post

12 REPLIES 12
Greg_Deckler
Super User
Super User

Quizás:

Measure =
  VAR __Table = 
    SUMMARIZE(
      'Table',
      [Product],
      "__Count",COUNTROWS('Table')
    )
RETURN
  COUNTROWS(FILTER(__Table,[__Count]>1))


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

se ve perfecto. ¡Gracias por tu ayuda!

¿Puedo preguntar además que hay alguna manera de calcular el "Precio" por el filtro anterior (contar producto >1)?

A+B+C-10+20+30+10+10+20+30

Se apreciará si hay alguna solución.

IdProductoPrecio neto
1A10
2B20
3C30
4A10
5A10
6B20
7D40
8E50
9F60
10C30

Hola

Escribir estas medidas

Total price = SUM(Data[Net Price])
Measure = SUMX(FILTER(SUMMARIZE(VALUES(Data[Product]),Data[Product],"ABCD",COUNTROWS(Data),"EFGH",[Total price]),[ABCD]>1),[EFGH])

Arrastre la segunda medida al objeto visual. El resultado será 130.

Espero que esto ayude.


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

@Ashish_Mathur Esto está funcionando perfectamente. Realmente apreciado!

@Ashish_Mathur , si es posible, me gustaría hacer un poco más basado en su fórmula proporcionada.

Para el mismo método de cálculo, ¿es posible que pueda contar "Procduct >1" sólo si "Precio neto" no está vacío?

Si este caso, el recuento de "C" es 1

sólo A & B es >1 y el precio de suma será 70.

Intento algo como pero no funciona.

Medidas: SUMX(FILTER(SUMMARIZE(VALUES('Table1'[Product]),'Table1'[Product],"ABCD",COUNTROWS('Table1'),"EFGH",[Precio total]),[ABCD]>1),[EFGH]<>BLANK())
IdProductoPrecio neto
1A10
2B20
3C
4A10
5A10
6B20
7D
8E50
9F60
10C30

Hola

Pruebe esta medida

Medidas: SUMX(FILTER(SUMMARIZE(VALUES('Table1'[Product]),'Table1'[Product],"ABCD",COUNTROWS('Table1'),"EFGH",[Precio total]),[ABCD]>1&&[EFGH]<>BLANK()),[EFGH])

Espero que esto ayude.


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

@Ashish_Mathur He probado las dos de estas dos medidas, todavía no puede obtener la respuesta de 70. Todavía cuentan el valor de C.

Se aprecia si pudiera sugerir

Medidas1 - SUMX(FILTER(SUMMARIZE(VALUES('Table1'[Product]),'Table1'[Product],"ABCD",
COUNTROWS('Table1'),"EFGH",[Precio total]),[ABCD]>1&&[EFGH]<>BLANK()),[EFGH])

Medida: CALCULATE(
SUM(Tabla1[Precio neto]),
FILTRO(Tabla1,Tabla1[Columna Countif]>1 && Tabla1[Precio neto] <>Blank()))Countif1.JPG

Hola

Escriba esta medida

Medidas: SUMX(FILTER(SUMMARIZE(VALUES('Table1'[Product]),'Table1'[Product],"ABCD",CALCULATE(COUNTROWS('Table1'),Table1[Net Price]>0),"EFGH",[Total price]),[ABCD]>1&&[EFGH]<>BLANK()),[EFGH]))))))))))))))))))).)).)))))))))))))))))))))))))))))))))))))))))))))))/[ABCD]>1&&[EFGH]<>BLANK()),[EFGH]))))))))))))))))))________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Espero que esto ayude.


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

Es brillante. Muchas gracias

De nada.


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

@Greg_Deckler ¿Piensas en hacerlo de todos modos. Muchas gracias

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors