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
Atif
Resolver I
Resolver I

Suma/Total de valores distintos

Tengo varios valores en la columna 1 y la columna 2, y quiero dividir cada valor distinto de la columna 1 con la suma de valores distintos de la columna 2 y los porcentajes de trazado con los valores de la columna 3.

1 ACCEPTED SOLUTION
FarhanAhmed
Community Champion
Community Champion

Hola

¿Puede compartir los datos de muestra de su column1 & column2? ambos están en la misma tabla ?

¿Podrías por favor probar

Store Distinct = 
Var a = DISTINCTCOUNT(Table1[Column1])
Var b = CALCULATE(DISTINCTCOUNT(Table1[Column2]),ALL(Table1))

REturn DIVIDE(a,b)







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

Proud to be a Super User!




View solution in original post

8 REPLIES 8
Atif
Resolver I
Resolver I

Atif_0-1604659100928.png

En lugar de dar 12.8% contra la marca Other1 dividiendo 47 de 366, está mostrando 100%. Todos los valores subsiguientes también son incorrectos.

La fórmula que he utilizado para obtener el total de todos los valores distintos de una columna es:

Total Distinct Store ID á COUNTX(DISTINCT(VALUES(Table1[ID de tienda])), CALCULATE(DISTINCT(Table1[ID de tienda])))

amitchandak
Super User
Super User

@Atif, No muy claro

Try - divide(distinctcount(Table[Column1]),distinctcount(Table[Column2]))

@amitchandak,gracias por la respuesta. Compruebe la instantánea y los detalles anteriores.

@Atif , ¿Dónde está la medida del denomintor

Y esto debe ser

Total Distinct Store ID - Distinctcount(Table1[ID de tienda])

FarhanAhmed
Community Champion
Community Champion

Hola

¿Puede compartir los datos de muestra de su column1 & column2? ambos están en la misma tabla ?

¿Podrías por favor probar

Store Distinct = 
Var a = DISTINCTCOUNT(Table1[Column1])
Var b = CALCULATE(DISTINCTCOUNT(Table1[Column2]),ALL(Table1))

REturn DIVIDE(a,b)







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

Proud to be a Super User!




The formula worked well. However, if I use a filter, the values are still divided by the Total Distinct Count rather than by the Filtered Distinct Count.

FarhanAhmed
Community Champion
Community Champion

A continuación, debe actualizar su fórmula para usar ALLEXCEPT en lugar de TODOS los

y agregue columnas de filtro en ALLEXCEPT

Store Distinct = 
Var a = DISTINCTCOUNT(Table1[Column1])
Var b = CALCULATE(DISTINCTCOUNT(Table1[Column2]),ALLEXCEPT(Table1,Table1[Column3],Table1[Column4]))

REturn DIVIDE(a,b)







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

Proud to be a Super User!




Thanks, a zillion, @FarhanAhmed!

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.