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
mra1984
Helper II
Helper II

Las ventas acumuladas se agotan demasiado

media_cost_ YTD
SI(
ISFILTERED('Calendar'[Fecha]),
ERROR("Las medidas rápidas de inteligencia de tiempo solo se pueden agrupar o filtrar por la jerarquía de fechas proporcionada por Power BI o la columna de fecha principal."),
TOTALYTD(SUM('ALLCHANNELS'[media_cost_]), 'Calendario'[Fecha].[ Fecha])
)
esto funciona, pero se extiende hasta finales de diciembre de 2020? ¿Cómo conseguir que sólo se vaya hasta hoy? Gracias
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@mra1984 - Puede crear una sentencia IF donde si la fecha máxima es > HOY, devuelva BLANK, de lo contrario devuelva el cálculo


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@mra1984 - Puede crear una sentencia IF donde si la fecha máxima es > HOY, devuelva BLANK, de lo contrario devuelva el cálculo


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

su solución suena más fácil... ¿cómo escribiría eso en mi fórmula? Gracias

amitchandak
Super User
Super User

@mra1984 , Pruebe como estos ejemplos

YTD QTY forced= 
var _max = maxx('order',[Order date])
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))

LYTD QTY forced= 
var _max1 =maxx('order',[Order date])
var _max = date(year(_max1)-1,month(_max1),day(_max1))
return
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)

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.