Forum Discussion
Current Fiscal month sales - DAX Error
I want to get the current sales in month for the Fiscal Date
this is my DAX Statement
Current Month Sales = CALCULATE(
SUM(Registrations[Revenue]),
FILTER('Date','Date'[FYMonthInYear] = MONTH(now())
&& 'Date'[FYYear]) = YEAR(NOW()))
this is the error
A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed
I am obviously missing how this statement works, help?
Please try this
Current Month Sales = CALCULATE(
SUM('Registrations'[Revenue]),
FILTER(
'Date',
'Date'[FYMonthInYear]=MONTH(NOW())
&& 'Date'[FYYear]=YEAR(Now()) )
)There is a really really subtle difference in where you have your closing brackets.
3 Replies
- Phil_Seamark
Microsoft Employee
Please try this
Current Month Sales = CALCULATE(
SUM('Registrations'[Revenue]),
FILTER(
'Date',
'Date'[FYMonthInYear]=MONTH(NOW())
&& 'Date'[FYYear]=YEAR(Now()) )
)There is a really really subtle difference in where you have your closing brackets.
- vanessafvg
Community Champion
thanks Phil_Seamark that works like a charm!
- computermike
Helper I
Very Nice
So say we are in Feb. and it works great. But when I filter my Pivot table for Jan, the values disappear. How could I alter my query, so it is unaffected by a date filter in my pivot table?