Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hola a todos,
Tengo una tabla con datos de envíos y quiero sumar la cantidad de envíos para el día anterior. Así que si hoy es lunes, quiero filtrar la tabla para el viernes (hoy -3) pero si hoy es cualquier otro día, sólo quiero filtrar para el día anterior (Hoy-1).
Probé el DAX a continuación, pero no funcionó:
Solved! Go to Solution.
Prueba algo como esto
MeasureVal =
VAR _weekday =
WEEKDAY ( TODAY (), 2 )
VAR _x =
IF ( _weekday = 1, 3, 1 )
VAR _result =
CALCULATE (
SUM ( 'Table1'[ShipmentAmount] ),
FILTER ( 'Table1', Table1[ShipmentDate] - _x )
)
RETURN
_result
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
Apreciar con un kudos 🙂
Gracias a todos por las respuestas rápidas. Pude hacerlo funcionar usando:
Gracias a todos por las respuestas rápidas. Pude hacerlo funcionar usando:
@SJ25 , consulte mi blog.
Crear un rango en
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])
y usar eso. He mostrado el uso de rango en [Work Date Cont],
Ahora -1 rango será ayer que es un día laborable
Me gustaría ❤ elogios si 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 en https://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.
Prueba algo como esto
MeasureVal =
VAR _weekday =
WEEKDAY ( TODAY (), 2 )
VAR _x =
IF ( _weekday = 1, 3, 1 )
VAR _result =
CALCULATE (
SUM ( 'Table1'[ShipmentAmount] ),
FILTER ( 'Table1', Table1[ShipmentDate] - _x )
)
RETURN
_result
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
Apreciar con un kudos 🙂