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.
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í.
Solved! Go to Solution.
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:
Hice una muestra simple para referencia, ver adjunto.
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:
Hice una muestra simple para referencia, ver adjunto.
@hashari , Puede utilizar filtros TOP N
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
Además, consulte Rango para este
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Amitchandak- 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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |