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, necesito ser capaz de obtener un promedio de 3 años un producto y también ser capaz de mostrarlo por mes. He creado un patrón, pero no puedo averiguar cómo excluir el contexto de filtro para el año actual en el informe.
Actual Qty Average =
Var FirstSDate = CALCULATE(STARTOFYEAR('Date Table'[DateKey]), KEEPFILTERS('Date Table'[Delta Years]=0))
RETURN
CALCULATE(AVERAGEX(VALUES('Date Table'[Year]),[Actual Qty]),KEEPFILTERS('Date Table'[DateKey]<FirstSDate))
Necesito que estos resultados aparezcan en este informe a continuación cuando se selecciona el código de producto específico y 2021 de la tabla de fechas..
Solved! Go to Solution.
Gracias por su ayuda @amitchandak, lo descubrí al final, obtuve el resultado deseado con el patrón a continuación. 😁
3 Year Average =
Var FirstSDate = CALCULATE(STARTOFYEAR('Date Table'[DateKey]), KEEPFILTERS('Date Table'[Delta Years]=0))
RETURN
CALCULATE(AVERAGEX(VALUES('Date Table'[Year]),[Actual Qty]),KEEPFILTERS('Date Table'[DateKey]<FirstSDate),REMOVEFILTERS('Date Table'[Year]))
@davehus , Pruebe una medida como con la tabla de fechas
Rolling 3 day = CALCULATE(Average('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,Day))
o
Rolling 3 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,Day)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,Day), filter(Sales,not(isblank(sum(Sales[Sales]))))))))
¿Puede compartir datos de ejemplo y salida de ejemplo en formato de tabla? O un pbix de ejemplo después de eliminar datos confidenciales.
Hola @amitchandak , Gracias por la respuesta 🙂
Tengo esa idea, sólo necesito que aparezca en mi informe cuando filtre el año en curso. La medida analiza los 3 años anteriores, por lo que necesito la medida para ignorar los filtros de mi informe. Espero que tenga sentido.
D
@davehus, si usted no necesita una tendencia entonces arriba con
Rolling 3 day = CALCULATE(Average('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,Year), all(Date))
o //sólo a nivel de año
CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]>=max('Date'[Year])-3 && 'Date'[Year]<=max('Date'[Year])) )
Si necesita tendencia, significa mostrar tres años cuando se selecciona uno, necesita una tabla independiente, consulte mi video
https://www.youtube.com/watch?v=44fGGmg9fHI&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=18
Gracias por su ayuda @amitchandak, lo descubrí al final, obtuve el resultado deseado con el patrón a continuación. 😁
3 Year Average =
Var FirstSDate = CALCULATE(STARTOFYEAR('Date Table'[DateKey]), KEEPFILTERS('Date Table'[Delta Years]=0))
RETURN
CALCULATE(AVERAGEX(VALUES('Date Table'[Year]),[Actual Qty]),KEEPFILTERS('Date Table'[DateKey]<FirstSDate),REMOVEFILTERS('Date Table'[Year]))
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 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |