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.
Hola
He revisado algunas de las otras publicaciones resueltas, pero parecen estar funcionando a partir de conjuntos de datos muy diferentes a los míos y no pude aplicarlos al tipo de datos con los que estoy trabajando.
He simplificado y eliminado los detalles de identificación de mis datos, pero se parece mucho a esto:
Llave | Respuesta | form_component_title | Month_Y |
1248289 | N/A | Pregunta 1 | Octubre 2022 |
1248289 | No | Pregunta 2 | Octubre 2022 |
1248289 | Sí | Pregunta 3 | Octubre 2022 |
1248290 | Sí | Pregunta 1 | Octubre 2022 |
1248290 | Sí | Pregunta 2 | Octubre 2022 |
1248290 | Sí | Pregunta 3 | Octubre 2022 |
1248294 | Sí | Pregunta 1 | Octubre 2022 |
1248294 | Sí | Pregunta 2 | Octubre 2022 |
1248294 | Sí | Pregunta 3 | Octubre 2022 |
1262112 | Sí | Pregunta 1 | Noviembre 2022 |
1262112 | Sí | Pregunta 2 | Noviembre 2022 |
1262112 | Sí | Pregunta 3 | Noviembre 2022 |
1262117 | Sí | Pregunta 1 | Noviembre 2022 |
1262117 | No | Pregunta 2 | Noviembre 2022 |
1262117 | Sí | Pregunta 3 | Noviembre 2022 |
Como puede ver, cada clave está asociada a tres preguntas diferentes, y cada pregunta puede tener una respuesta diferente. La fecha de la clave siempre es consistente y no cambiará, es decir, la clave 1262117 tendrá fecha de noviembre de 2022 para todas las preguntas.
Con una segmentación de datos, puedo crear fácilmente un gráfico que muestre el porcentaje de respuestas "sí" para cada pregunta para un mes determinado.
Sin embargo, lo que estoy buscando hacer es que el gráfico muestre el mes seleccionado Y el mes anterior como punto de comparación, por lo que si selecciono noviembre en la segmentación de datos, me mostrará octubre y noviembre como se muestra a continuación.
La segmentación de datos se conecta a muchos otros elementos visuales en la misma pestaña, por lo que no puedo seleccionar octubre y noviembre en la segmentación de datos, ya que eso interferirá con los otros elementos visuales.
¿Tiene alguna sugerencia o forma de hacer que esto suceda en PowerBI?
Muchas gracias de antemano 🙂
Para su escenario, puede crear una tabla de calendario, una tabla de tipo de respuesta y, a continuación, crear medidas para obtener los valores del mes actual y el mes anterior.
ThisMonth = var _yes=CALCULATE(COUNT('Table'[form_component_title]),FILTER(ALLSELECTED('Table'),[form_component_title]=MAX('Table 2'[form_component_title])&&[Answer]="Yes"&&MONTH([Month_Y])=SELECTEDVALUE('Calendar'[Month])&&YEAR([Month_Y])=SELECTEDVALUE('Calendar'[Year])))
var _total=CALCULATE(COUNT('Table'[form_component_title]),FILTER(ALLSELECTED('Table'),[form_component_title]=MAX('Table 2'[form_component_title])&&MONTH([Month_Y])=SELECTEDVALUE('Calendar'[Month])&&YEAR([Month_Y])=SELECTEDVALUE('Calendar'[Year])))
return DIVIDE(_yes,_total)
PreviousMonth = var _yes=CALCULATE(COUNT('Table'[form_component_title]),FILTER(ALLSELECTED('Table'),[form_component_title]=MAX('Table 2'[form_component_title])&&[Answer]="Yes"&&MONTH([Month_Y])=SELECTEDVALUE('Calendar'[Month])-1&&YEAR([Month_Y])=SELECTEDVALUE('Calendar'[Year])))
var _total=CALCULATE(COUNT('Table'[form_component_title]),FILTER(ALLSELECTED('Table'),[form_component_title]=MAX('Table 2'[form_component_title])&&MONTH([Month_Y])=SELECTEDVALUE('Calendar'[Month])-1&&YEAR([Month_Y])=SELECTEDVALUE('Calendar'[Year])))
return DIVIDE(_yes,_total)
Saludos
Esteban Tao
Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@akoerber , Crear una fecha a partir de Mes
Fecha = datevalue("01 " &[Month_Y] )
Puede unirlo con la tabla de fechas y usar la intellignece de tiempo
Ejemplos
Ventas MTD = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESMTD('Fecha'[Fecha]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
último mes Ventas = CALCULAR(SUMA(Ventas[Importe de ventas]),mes anterior('Fecha'[Fecha]))
Ventas MTD = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESMTD('Fecha'[Fecha]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Inteligencia de tiempo, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Período personalizado hasta la fecha: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI: mes a mes con o sin inteligencia de tiempo
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
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 |