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

October 28 & 29: Experts share their secrets on how to pass the Fabric Analytics Engineer certification exam—live. Learn more

Reply
fabianfilth
Regular Visitor

DateAdd

Hello power bi team,

 

Can you please give me some help on the following

 

I want to create a measure that calculates the total cost of the last day of the previous month of the previous year, but in the ENDOMONTH function more specifically in the DATEADD function, I get the error "A function DATEADD has been used in a True/False expression that is used as a table filter expression. This is not allowed".

How can I solve that?

fabianfilth_0-1671156515319.png

 

thanks in advice

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @fabianfilth 

please try

=
CALCULATE (
[Costo Total],
'Dim Fecha'[Date] = EOMONTH ( 'Calidad Inventario'[Fecha Cargue], -12 ),
ALL ( 'Dim Fecha' )
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @fabianfilth 

please try

=
CALCULATE (
[Costo Total],
'Dim Fecha'[Date] = EOMONTH ( 'Calidad Inventario'[Fecha Cargue], -12 ),
ALL ( 'Dim Fecha' )
)

tamerj1
Super User
Super User

Hi @fabianfilth 

please try

=
CALCULATE (
[Costo Total],
'Dim Fecha'[Date] = EOMONTH ( 'Calidad Inventario'[Fecha Cargue], -12 ),
ALL ( 'Dim Fecha' )
)

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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