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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
fmunoz
Frequent Visitor

Ventas acumuladas que no tengan en cuenta el filtro de fechas

Estoy creando una tabla que contiene las Ventas y Ventas YTD (acumuladas). Sobre esta tabla estoy aplicando un filtro de fechas (desde-hasta)

Es posible que dentro de la misma tabla para el dato Ventas YTD no aplique el filtro de fechas, es decir, que siempre me calcule las ventas acumuladas del año sin tener en el filtro de fechas.

 

Gracias

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @fmunoz 

You can create a Calculated column or Measure.

 

 

YTD column =

var today = TODAY()

return CALCULATE(SUM('Table'[Importe Ventas]), FILTER(ALL('Table'),YEAR('Table'[Fecha]) =YEAR(Today()) && DAY('Table'[Fecha]) <= today) )

 

 

The result looks like this:

v-cazheng-msft_0-1617950870522.png

 

For more details, you can refer the attached pbix file.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
v-cazheng-msft
Community Support
Community Support

Hi @fmunoz 

Is your problem solved?

 

Best Regards

Caiyun Zheng

v-cazheng-msft
Community Support
Community Support

Hi @fmunoz 

You can create a Calculated column or Measure.

 

 

YTD column =

var today = TODAY()

return CALCULATE(SUM('Table'[Importe Ventas]), FILTER(ALL('Table'),YEAR('Table'[Fecha]) =YEAR(Today()) && DAY('Table'[Fecha]) <= today) )

 

 

The result looks like this:

v-cazheng-msft_0-1617950870522.png

 

For more details, you can refer the attached pbix file.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? 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

@fmunoz , if you have chosen a date

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

without selecting a date

 

YTD=
var _min = date(year(today()),1,1)
var _day = today()
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) && 'Date'[Day of Year] <= _day) )

 

if this does not help

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Hola, 

Muchas gracias por la ayuda, pero no resuelve mi problema...

Tengo un filtro de fechas aplicado para todas las páginas del informe.

¿Es posible calcular el total acumulado del año actual sin tener en cuenta la fecha del filtro?

 

fmunoz_0-1617873264649.png

En este caso la columna de YTD debería reflejar el total del año (es decir, hasta 08/04/2021)

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.