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

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.

Reply
erhan_79
Post Prodigy
Post Prodigy

Ayuda de medición

Hola;

Necesito su pequeña ayuda, tengo una mesa como abajo necesito calcular con unMedida sólo la suma de la cantidad del mes actual y el mes anterior

Para el ejemplo siguiente, como usted ve el mes actual y las fechas anteriores están firmados con amarillo, y necesito capturar la cantidad total " 300"

Pero pls no se olvide de lo principal al abrir el informe, el sistema comparará la fecha del informe de apertura y encontrará la cantidad del mes actual y los importes del mes anterior.

Espero que esté claro, gracias de antemano

caps1.JPG

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@erhan_79

Pruebe a continuación la siguiente medida:

Measure = 

CALCULATE(
    SUM(Table1[Amount]),
    FILTER( ALL(Table1[Date]) , 
        Table1[Date] <= EOMONTH(TODAY(),0)
    )
)

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@erhan_79

Pruebe a continuación la siguiente medida:

Measure = 

CALCULATE(
    SUM(Table1[Amount]),
    FILTER( ALL(Table1[Date]) , 
        Table1[Date] <= EOMONTH(TODAY(),0)
    )
)

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Muchas gracias @Fowmy

AllisonKennedy
Super User
Super User

@erhan_79 No estoy seguro de entender su pregunta - ¿está tratando de encontrar una suma acumulada de todo, incluyendo este mes y antes? ¿Tiene una tabla DimDate? Necesitará uno con una columna de tipo de datos Date y una columna de mes.

https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

Hay algunas opciones aquí. Puede filtrar esto con una segmentación de fecha relativa o usar una medida explícita con filtro dentro de la medida, como:

AmountToDate (Fecha de La Cantidad de Datos)

CALCULATE(SUM(Table[Amount]), MONTH(DimDate[Date]) <- MONTH(TODAY()) && YEAR(DimDate[Date]) á YEAR(TODAY()) )


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

querido @AllisonKennedy;

No tengo tabla dat tenue, estoy trabajando en un dato en vivo, así que no puedo crear una fecha tenue. ¿No es posible resolver sin Dimdate?

sí, estoy tratando de encontrar una suma acumulada de todo, incluyendo este mes y antes

Gracias

@erhan_79 , Sí es posible sin tabla de fechas, sólo tiene que utilizar la columna Fecha de la tabla en lugar de la tabla DimDate. Tenga en cuenta que mi solución supone que solo desea datos de este año. Consulte la solución de @Fowmy para obtener una solución más elegante si desea TODOS los datos de todos los años anteriores hasta este mes.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@erhan_79 , Una manera con la tabla de fechas, acumulada hasta el mes pasado

Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <-maxx(date,dateadd(date[date]),-1,month)))

o los últimos meses

Rolling 6 hasta el último 1 mes - CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-1,month)),-6,MONTH))

y este mes

Ventas MTD: CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únete a ella con la columna de fecha de tus hechos. Consulte :radacad sqlbi My Video Series Aprecia tus Felicitaciones.

querido @amitchandak;

se puede comprobar a continuación fórmula , podría ser algo mal ? , algo no está funcionando.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.