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.
Me gustaría crear un gráfico de líneas que muestre mi semana actual frente a la semana pasada de un valor total. Sé que necesito 2 medidas aquí, pero las ecuaciones de base de tiempo de la semana que he probado no están funcionando.
Tengo mi calendario de fechas con el número de semana y el número del día de la semana (el domingo comienza la semana para nosotros).
¿Alguien ha tenido alguna oportunidad con conseguir que esto funcione? Cualquier ejemplo que he encontrado no funciona para mí. ¡Gracias!
Solved! Go to Solution.
He hecho un trabajo extenso con semanas. Lo que utilizo es la siguiente lógica:
Prior Year Sales =
VAR CurrentWeek =
MAXX(
'Sales',
RELATED( 'Date'[Week of Year] )
)
VAR CurrentYear =
MAXX(
'Sales',
RELATED( 'Date'[Year] )
)
VAR PriorYearSales =
SUMX(
FILTER(
ALL( Sales ),
RELATED( 'Date'[Year] ) = CurrentYear - 1
&& RELATED( 'Date'[Week of Year] ) = CurrentWeek
),
Sales[SubTotal]
)
RETURN
PriorYearSales
Usted una ver las ventas de la semana 2011 23-26 están mostrando en el año anterior para 2012 para esas mismas semanas.
Aquí hay un enlace a mi archivo PBIX si desea jugar con él.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHola, @Dawn_K
Si usted toma la respuesta de alguien, por favor márquela como la solución para ayudar a los otros miembros que tienen los mismos problemas a encontrarla más rápidamente. Si no, avísame y trataré de ayudarte más. Gracias.
Saludos
Allan
Hola, @Dawn_K
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede crear una columna calculada y una medida como bleow.
Calculated column:
Weeknum = WEEKNUM('Table'[Date])
Measure:
LastWeekValue =
var _lastweeknum = SELECTEDVALUE('Table'[Weeknum])-1
var _result =
CALCULATE(
SUM('Table'[Value]),
'Table'[Weeknum] = _lastweeknum
)
return
_result
Resultado:
Saludos
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
He hecho un trabajo extenso con semanas. Lo que utilizo es la siguiente lógica:
Prior Year Sales =
VAR CurrentWeek =
MAXX(
'Sales',
RELATED( 'Date'[Week of Year] )
)
VAR CurrentYear =
MAXX(
'Sales',
RELATED( 'Date'[Year] )
)
VAR PriorYearSales =
SUMX(
FILTER(
ALL( Sales ),
RELATED( 'Date'[Year] ) = CurrentYear - 1
&& RELATED( 'Date'[Week of Year] ) = CurrentWeek
),
Sales[SubTotal]
)
RETURN
PriorYearSales
Usted una ver las ventas de la semana 2011 23-26 están mostrando en el año anterior para 2012 para esas mismas semanas.
Aquí hay un enlace a mi archivo PBIX si desea jugar con él.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@Dawn_K tantas publicaciones y videos sobre esto, algunos enlaces aquí, si ninguno funciona, comparten datos y explican lo que no está funcionando
https://www.youtube.com/watch?v=jclWnA7pEvY
https://www.youtube.com/watch?v=2ya3pdgemP4
https://www.youtube.com/watch?v=jBPLm5BHl2c
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!
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.
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 | |
2 | |
1 |