cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
DavidWaters100
Post Patron
Post Patron

FECHASMTD menos problema de un día

Hola

Tengo una segmentación de mes que los usuarios pueden seleccionar, luego una medida usando DATESMTD para capturar todas las ventas en el mes elegido. Sin embargo, ahora tengo un requisito para capturar DATESMTD menos 1 día. Así que si un usuario selecciona junio de 2020, necesito las ventas del 31 de mayo al 29 de junio (todo cambió un día). Creo que ya no puedo usar DATESMTD ya que esto siempre excluirá mayo. ¿Alguien tiene una idea de cómo se puede lograr esto por favor? A continuación se muestra la medida, gracias!

Sales- Calculate(sum(Sales[Amount]),DATESMTD('Calendar Table'[Date]), Sales[Status]-"Type A")
Proud to be a Super User!
5 REPLIES 5
v-diye-msft
Community Support
Community Support

Hola @DavidWaters100

Si ha solucionado el problema por su cuenta, por favor comparta su solución. si los mensajes anteriores ayudan, por favor márquelo como una solución para ayudar a otros a encontrarlo más rápidamente. Si no, por favor, amablemente elaborar más. ¡Gracias!

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@DavidWaters100, el primero debería trabajar


Sales- Calculate(sum(Sales[Amount]),DATESMTD(dateadd('Calendar Table'[Date],1,day)), Sales[Status]-"Tipo A")

Si no lo intente

Sales- Calculate(sum(Sales[Amount]),DATESMTD(dateadd('Calendar Table'[Date],-1,day)), Sales[Status]-"Tipo A")

Hola @amitchandak,

Gracias por su respuesta - esto debería funcionar para el YTD también (He publicado una segunda respuesta a mi propio post, ya que me di cuenta de que tenía un problema con YTD también).

Voy a darle una oportunidad

Proud to be a Super User!
DavidWaters100
Post Patron
Post Patron

¡Creo que lo resolví por abajo!

Ventas: Calculate(sum(Sales[Amount]),DATESBETWEEN('Calendar Table[Date],min('Calendar Table'[Date])-1,max('Calendar Table'[Date])-1), Sales[Status]-"Type A")
Proud to be a Super User!

Ah - También tengo una medida YTD que tiene que ser menos uno también. ¿Alguien tiene una solución para esto, por favor? No puedo usar Min y Max porque eso sólo afecta el mes seleccionado, ¡necesito abrirme a todo el año menos un día! Por debajo de la medida:

Ventas YTD á (calcular(suma(Ventas[ventas]),DATESYTD('Tabla de calendario'[Fecha]),Ventas[Tipo]-"Tipo A")

Así que necesito arriba ser 31/12/2019 a 29/06/2020, cuando un usuario selecciona Junio 2020

¡Gracias!

Proud to be a Super User!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors