Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Solved! Go to Solution.
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.
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.
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |