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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
EdwardChurches
Frequent Visitor

Unable to filter dates correctly

Hi,

 

Im new to DAX and Im having trouble using the calculate formula to filter dates. This is what i did:

 

1. Found the beginning of the latest month using this formula: 

 

bMonth:=EOMONTH ( MAX ( fTransactions[Emision] ), -1 ) + 1
   

2. Use calculate function to filter everything after  that date: 

 

CALCULATE ( [Units], FILTER ( dDate, dDate[Date] >= [bMonth] ) )

 

I know the error is in step 1 because if  I replace [bMonth] for the DATE formula, the filter works fine.

 

I dont understand what im doing wrong, can  somenone please help?

1 ACCEPTED SOLUTION
EdwardChurches
Frequent Visitor

Well... aparently I just solved this by joining step one and two togehter: 

 

CALCULATE ( [Units]FILTER ( dDate, dDate[Date] >= EOMONTH ( MAX ( fTransactions[Emision] ), -1 ) + 1 ) )

 

I dont know why that makes a difference but there it is.

View solution in original post

1 REPLY 1
EdwardChurches
Frequent Visitor

Well... aparently I just solved this by joining step one and two togehter: 

 

CALCULATE ( [Units]FILTER ( dDate, dDate[Date] >= EOMONTH ( MAX ( fTransactions[Emision] ), -1 ) + 1 ) )

 

I dont know why that makes a difference but there it is.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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