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 a todos,
Estoy strugeling para venir con una solución para construir un informe que muestra la tendencia de incidentes y acciones a lo largo del tiempo y ser capaz de filtrar este informe por ubicación. Puedo obtener los resultados que quiero creando una tabla de resumen y pocas medidas, pero mi problema es que no puedo filtrar esa tabla de resumen en función de la tabla de ubicaciones. Este es el ejemplo.
Tengo 3 tablas enlazadas entre sí a través de Location ID:
Puesto que no hay acciones o incidentes necesarios para cada mes, estoy generando un nombre de tabla adicional Tabla de resumen que me permitirá mostrar la tendencia de la diferente caluclación durante cada período, incluso para el mes donde no hay incidentes ni acciones. Mi problema es cómo filtrar los resultados de esta tabla de resumen por la ubicación.
Estas son mis medidas utilizadas en la tabla de resumen:
Solved! Go to Solution.
Ahí, @Adri1
Puede una tabla de fechas como se muestra a continuación. El archivo pbix se adjunta al final.
Calendar = CALENDARAUTO()
A continuación, puede crear medidas como se muestra a continuación.
Start Period = MIN('Calendar'[Date])
End Period = MAX('Calendar'[Date])
Incident =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT(Incident[Incident ID]),
FILTER(
ALLSELECTED(Incident),
Incident[Created On]>=startperiod&&
Incident[Created On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Created Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Created On]>=startperiod&&
'Action'[Created On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Closed Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Closed On]>=startperiod&&
'Action'[Closed On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Closed On Time Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Closed On]>=startperiod&&
'Action'[Closed On]<=endperiod&&
'Action'[Due On]>endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Past Due Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Created On]>=startperiod&&
'Action'[Calc Closed On]>endperiod&&
'Action'[Due On]<endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
resultado:
Saludos
Allan
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Ahí, @Adri1
Puede una tabla de fechas como se muestra a continuación. El archivo pbix se adjunta al final.
Calendar = CALENDARAUTO()
A continuación, puede crear medidas como se muestra a continuación.
Start Period = MIN('Calendar'[Date])
End Period = MAX('Calendar'[Date])
Incident =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT(Incident[Incident ID]),
FILTER(
ALLSELECTED(Incident),
Incident[Created On]>=startperiod&&
Incident[Created On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Created Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Created On]>=startperiod&&
'Action'[Created On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Closed Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Closed On]>=startperiod&&
'Action'[Closed On]<=endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Closed On Time Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Closed On]>=startperiod&&
'Action'[Closed On]<=endperiod&&
'Action'[Due On]>endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
Past Due Action =
var startperiod = [Start Period]
var endperiod = [End Period]
var result =
CALCULATE(
DISTINCTCOUNT('Action'[Action ID]),
FILTER(
ALLSELECTED('Action'),
'Action'[Created On]>=startperiod&&
'Action'[Calc Closed On]>endperiod&&
'Action'[Due On]<endperiod
)
)
return
IF(
ISBLANK(result),
0,
result
)
resultado:
Saludos
Allan
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@Adri1 , Debe crear una tabla de fechas y se combinará con todas las fechas en dos tablas. Solo una relación estará activa en cada tabla.
El uso userelation para activar.
Refiera mi blog sobre temas similares
@Adri1 le falta una tabla de dimensiones de fecha que es clave para todo esto. Como práctica recomendada, agregue la dimensión de fecha en el modelo y utilelo para los cálculos de inteligencia de tiempo y tiempo. Una vez agregada la dimensión de fecha, márquela como una tabla de fechas en las herramientas de tabla.
https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...
Aunque proporcionó mucha información, será más fácil si lanza algunos datos de ejemplo o pbix con datos de ejemplo y su salida esperada, ayudará a proporcionar una solución.
Me gustaría❤ elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Gracias que funciona ahora
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |