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
Mainer04401
Helper III
Helper III

Todos los elegidos en Matrix Drilldown

Creé una medida para el % de las ventas con la siguiente medida:

Sales Vol Contrib á divide([Total_Vol],calculate([Total_Vol],allselected(StoreList)),0)

Funciona, pero en una matriz con un desglose en las filas, ¿hay alguna manera de que el denominador incluya solo la fila primaria?

Vea la siguiente captura de pantalla para obtener un ejemplo. [Condado, Estado] es las filas principales de [Ciudad, Estado] en la tabla StoreList ...

drilldown-example.JPG

En el ejemplo de Portland, ME, ¿cómo puedo hacer que la contribución del vol de ventas sea 40.5% (1,690 / 4,174) en lugar de 11% (1,690 / 14,867) como se muestra, sin afectar a las filas de padres que muestran la contribución del condado al estado?

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hola @Mainer04401, utilicé algunos datos simples para probar y obtener lo que necesita. Por favor, pruebe el siguiente método.

Datos de ejemplo 'Ventas':

10201.jpg

Crear medidas:

Total Sales = SUM(Sales[Total])

Contribution 2 = DIVIDE([Total Sales],CALCULATE([Total Sales],ALLSELECTED(Sales)),0)

Contribution 3 = DIVIDE([Total Sales],CALCULATE([Total Sales],ALLEXCEPT(Sales,Sales[Country, State])),0)

Final Contribution = IF(ISFILTERED(Sales[City, State]),[Contribution 3],[Contribution 2])

Ponga contribución final en la matriz y vea el resultado:

10202.jpg

Referencia para ISFILTERED: https://docs.microsoft.com/en-us/dax/ISFILTERED-function-dax

Saludos

Equipo de apoyo a la comunidad _ Jing Zhang

Si este post ayuda,por favor considere Aceptarlo como la solución para ayudar a otros miembros a encontrarlo.

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hola @Mainer04401, utilicé algunos datos simples para probar y obtener lo que necesita. Por favor, pruebe el siguiente método.

Datos de ejemplo 'Ventas':

10201.jpg

Crear medidas:

Total Sales = SUM(Sales[Total])

Contribution 2 = DIVIDE([Total Sales],CALCULATE([Total Sales],ALLSELECTED(Sales)),0)

Contribution 3 = DIVIDE([Total Sales],CALCULATE([Total Sales],ALLEXCEPT(Sales,Sales[Country, State])),0)

Final Contribution = IF(ISFILTERED(Sales[City, State]),[Contribution 3],[Contribution 2])

Ponga contribución final en la matriz y vea el resultado:

10202.jpg

Referencia para ISFILTERED: https://docs.microsoft.com/en-us/dax/ISFILTERED-function-dax

Saludos

Equipo de apoyo a la comunidad _ Jing Zhang

Si este post ayuda,por favor considere Aceptarlo como la solución para ayudar a otros miembros a encontrarlo.

mahoneypat
Employee
Employee

Simplemente agregue la columna Ciudad, Estado a su ALLSELECTED como se muestra a continuación.

Sales Vol Contrib á divide([Total_Vol],calculate([Total_Vol],allselected(StoreList[City, State])),0)

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


pranit828
Community Champion
Community Champion

Hola @Mainer04401

Tratar

Sales Vol Contrib á divide([Total_Vol],calculate(sum([Total_Vol]),allexcept('table','table'[parent1],'table'[parent2])),0)





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@pranit828 Gracias, pero eso no logra el resultado deseado

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.