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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
mpmsltd
Helper I
Helper I

Inicio del año + 3 meses Cálculo DAX

Hola a todos

Estoy tratando de crear una fórmula DAX que para cada año hace una suma de mis valores desde el día 1 hasta el día 90 del mismo año.

Traté de usar el DAX a continuación, pero realmente no funcionó, tengo el siguiente error:

se suministró una tabla de múltiples valores donde se esperaba un único valor

Año + 3 Meses IT - CALCULATE(sum(Values[values]),DATESBETWEEN('DATE'[Date],STARTOFYEAR('DATE'[Date]),DATEADD('DATE'[Date],3,MONTH)))
Cualquier ayuda es apreciada,
¡Gracias!
3 REPLIES 3
Greg_Deckler
Super User
Super User

Quizás:

Year + 3 Months IT = 
VAR __YearStart = DATE(YEAR('Values'[Date]),1,1)
VAR __End = (__YearStart + 89) * 1.
RETURN
  SUMX(
    FILTER(
      'Values',
      [Date] >= __YearStart && [Date] <= __End
    ),
    'Values'[Value]
  )


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Su solución fue una gran ayuda, realmente lo apreció!

Gracias Greg, he ajustado un poco ya que la función Año no me dejaba añadir una columna, sino sólo otra función.

Esto es lo que hice y funcionó

Año + 3 Meses IT ?
VAR __YearStart de TRABAJO: STARTOFYEAR('FECHA'[Fecha])
VAR __End (__YearStart + 89) * 1.
devolución
SUMX(
FILTRO (
Valorado
Valores[Fecha] >- __YearStart && Valores[Fecha]<- __End
),
Valores[Valor]
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors