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
hashari
Helper I
Helper I

Matriz Visual: Recuento de Valores Totales Un Filtro Nivel Arriba

Tengo una matriz visual, por el bien de este ejemplo:

a) El nivel más alto antes de expandirse es Región (hay 2 Regiones)

b) El siguiente nivel es el distrito (hay 5 distritos en una región)

c) El nivel más bajo es La tienda (hay 10 tiendas en un distrito)

Lo que estoy tratando de llegar es una medida / columna que cuenta el siguiente nivel.

Así, por ejemplo, si :

i. ampliar mi matriz hasta el nivel de la tienda, quiero ver un recuento de 50 (10 tiendas en un distrito * 5 distritos)

ii. ampliar mi matriz hasta el nivel de distrito, quiero ver un recuento de 100 (10 tiendas en un Distrito * 5 Distritos * 2 Regiones)

No estoy seguro de adónde ir desde aquí.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hola @hashari ,

Cree una medida como se muestra a continuación:

Measure = 
var _store=CALCULATE(DISTINCTCOUNT('Table'[store]),FILTER(ALL('Table'),'Table'[district ]=MAX('Table'[district ])&&'Table'[Region ]=MAX('Table'[Region ])))
var _district=CALCULATE(DISTINCTCOUNT('Table'[district ]),FILTER(ALL('Table'),'Table'[Region ]=MAX('Table'[Region ])))
var _region=CALCULATE(DISTINCTCOUNT('Table'[Region ]),ALL('Table'))
Return
IF(ISINSCOPE('Table'[store]),_store*_district,IF(ISINSCOPE('Table'[district ]),_store*_district*_region,COUNTROWS('Table')))

Y verás:

Annotation 2020-08-11 170147.png

Hice una muestra simple para referencia, ver adjunto.

Saludos
Kelly
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hola @hashari ,

Cree una medida como se muestra a continuación:

Measure = 
var _store=CALCULATE(DISTINCTCOUNT('Table'[store]),FILTER(ALL('Table'),'Table'[district ]=MAX('Table'[district ])&&'Table'[Region ]=MAX('Table'[Region ])))
var _district=CALCULATE(DISTINCTCOUNT('Table'[district ]),FILTER(ALL('Table'),'Table'[Region ]=MAX('Table'[Region ])))
var _region=CALCULATE(DISTINCTCOUNT('Table'[Region ]),ALL('Table'))
Return
IF(ISINSCOPE('Table'[store]),_store*_district,IF(ISINSCOPE('Table'[district ]),_store*_district*_region,COUNTROWS('Table')))

Y verás:

Annotation 2020-08-11 170147.png

Hice una muestra simple para referencia, ver adjunto.

Saludos
Kelly
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

- Miré a través de algunos de esos ejemplos, pero no estoy seguro de si estoy conectando los puntos correctamente.

Supongo que necesito un poco más de ayuda para llegar a mi punto final 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.