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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.