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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors