Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hola
Estoy haciendo un informe donde no tengo un calendario de citas. Así que no puedo utilizar funciones de TI como SAMEPERIODLASTYEAR o DATEADD, porque lo único que es relevante en mis datos son las estaciones, por ejemplo, temporada 2002/2003, 2003/2004 ..... 2020/2021
En este escenario, al crear un KPI, ¿cómo puedo crear una medida que cambie dinámicamente en función de los filtros que selecciono? Así que cuando filtro en 2018/2019.
Mi KPI muestra ese año + año anterior (2017/2018). Cuando selecciono 2006/2007, mi KPI muestra ese año + año anterior (2005/2006).
¿Alguien que tenga una idea?
Hola @Gjakova
Prueba esta medida.
Current+PrevYear =
VAR selectedYearKey = SELECTEDVALUE(Years[Year_KEY])//Decide how will you handle no selection and mutiple selection
VAR PrevYearKey = selectedYearKey - 1
Return SUMX(
FILTER(ALL(Scores), Scores[Year_KEY] in {selectedYearKey, PrevYearKey})
, Scores[Score])
Espero que esto ayude.
Por favor, márquelo como una solución si sirve para el propósito.
Gracias
@Gjakova , Prefiere tener una tabla De año separada al menos , Trate de usar el año numérico o el rango para obtener eso.
Con tabla de fecha/año
Este año: CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])))
Last Year ? CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])-1))
comprobar la opción de sin usar inteligencia de tiempo
Power BI — Preguntas YTD — Inteligencia de tiempo 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
@Gjakova solución adjunta
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 relacionadas 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.
Hola @amitchandak,por desgracia no puedo trabajar con tablas de citas. Tampoco trabajo con años completos, sino con temporadas. Así temporada 2017/2018 etc.
Si tiene tiempo, ¿podría probar su método con mis datos de muestra? Lo intenté, pero no puedo hacer que funcione. ¡Esperamos saber de ti!
@Gjakova si tiene un campo numérico que identifica el orden del año, puede lograrlo utilizando la siguiente medida
Previous Year =
VAR __id = MAX ( TableYear[Id] )
VAR __prevId = __id - 1
RETURN
CALCULATE ( SUM ( Table[Amount] ), TableYear[Id] = __prevId )
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 relacionadas 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.
Intenté tu respuesta, pero en parte funciona @parry2k
Cuando pongo mi medida en una mesa y también los años, que sólo muestra el total anterior, pero los años permanecen en blanco.
¿Podría probarlo con mis datos de muestra y ver si logra hacerlo funcionar? Si funciona, entonces puedo replicar ese mismo truco en mi conjunto de datos real. Muchas gracias de antemano!