Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Función DATEADD

Hola, tengo un problema para calcular un total. Esto es lo que estoy tratando de hacer. Al final estoy tratando de calcular el total para el día anterior. Si el día anterior cae el domingo, entonces tome el día antes de eso. Ni siquiera he llegado tan lejos. Primero estaba tratando de obtener resultados precisos para el día anterior. Dado que hoy es 8/3/2020, la fecha del día anterior es 8/2/2020. Sin embargo, verá en mi captura de pantalla a continuación estoy obteniendo resultados extraños. He escrito las medidas utilizadas y lo que estoy recibiendo en una matriz. ¿Puede alguien explicar lo que está pasando aquí? Para ambas medidas estoy esperando ver 8/2/2020 en la fila para la fecha y en blanco para el total ya que sólo tengo 46 registros el 31 de julio. Además, ¿cómo crearía mi medida para tener en cuenta el regreso de un día adicional si el día anterior es domingo?

Untitled.png

Gracias de antemano!

3 REPLIES 3
amitchandak
Super User
Super User

@USMC2001 , Usted puede crear rango como se da en este. Cambiar la fórmula para tener sólo el domingo como día festivo

https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Encontrar el día anterior con Rank es lo mismo que encontrar la semana pasada usando Rank

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
v-lionel-msft
Community Support
Community Support

Hola @USMC2001 ,

v-lionel-msft_0-1596506546659.png

Por favor, dé estas dos tablas de muestra y crearé la fórmula DAX para usted.

Saludos
Lionel Chen

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

parry2k
Super User
Super User

@USMC2001 cambiar su medida principal a esto:

No Response = CALCULATE ( SUM ( 'Table'[Total] ), 'Table'[Y/N] = "No Response" ) 

y también asegúrese de que su tabla de _calendar está marcada como una tabla de fechas.

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors