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
vanessafvg
Super User
Super User

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?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




1 ACCEPTED SOLUTION
Phil_Seamark
Employee
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.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
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.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

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?

thanks @Phil_Seamark that works like a charm!  

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.