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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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