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.
Saludos comunidad!
necesito de vuestra ayuda para resolver la siguiente situación:
poseo un dataset similar a este:
el objetivo que se me ha planteado es obtener a base de una selección de id_product en una fecha especifica, obtener una matriz o tabla similar a esto (ver imagen) suponiendo que selecciono el valor para la fecha '17/09/2020' :
el resultado debe ser la trasposición en base a la fecha o producto seleccionado y contar 7 días anteriores asignando los valores de campo como muestra en la imagen(o similar), si bien esto he logrado realizarlo mezclando los filtros de objeto en la matriz resultante con un top 7 de los registros, no logro modificar el valor de nombre para cada día. que solución me sugieren?
un aspecto que me lo hace más díficil es que no siempre son fechas consecutivas, hay alguna forma de rellenar estas fechas con valor 0?
se agradece cualquier información y aporte
Solved! Go to Solution.
That's a good dataset structure. You can get your result with TOPN(7) and some filters. Be aware that the Top 7 results before a given date are different for each product. Do you need to show results for multiple products in the same visual?
Here is some meta code for the simple scenario (single product). Note: use a disconnected dates table to feed the slicer.
Include :=
var p = selectedvalue(visual[product])
var vd = selectedvalue(values[date])
var sd = selectedvalue(slicer[date])
var r = calculatetable(TOPN(7,values[date],,desc),date<sd,product=p,value>0)
var i = intersect(r,vd)
return countrows(i)>0
That's a good dataset structure. You can get your result with TOPN(7) and some filters. Be aware that the Top 7 results before a given date are different for each product. Do you need to show results for multiple products in the same visual?
Here is some meta code for the simple scenario (single product). Note: use a disconnected dates table to feed the slicer.
Include :=
var p = selectedvalue(visual[product])
var vd = selectedvalue(values[date])
var sd = selectedvalue(slicer[date])
var r = calculatetable(TOPN(7,values[date],,desc),date<sd,product=p,value>0)
var i = intersect(r,vd)
return countrows(i)>0
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |