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
VilleMasa
New Member

First date of last month in a logical comparison

I am using this expression in filter part of calculate function:

 

D_Employee[RowActiveFrom] < FIRSTDATE(PREVIOUSMONTH('Calendar'[date]))


However Power BI doesn't calculate it and gives this error:


"A function 'FIRSTDATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

I'm just trying to compare the first date with another date and don't understand what is wrong here. Is there something to be corrected or a workaround to be used?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@VilleMasa , for the first date of last month

eomonth('Calendar'[date],-2)+1

 

In case of measure you might have to use

eomonth(max('Calendar'[date]) ,-2)+1

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@VilleMasa , for the first date of last month

eomonth('Calendar'[date],-2)+1

 

In case of measure you might have to use

eomonth(max('Calendar'[date]) ,-2)+1

 

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.

Top Solution Authors