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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
CSPedrao
Regular Visitor

Power BI Filter Function Error

Hi,

I was wondering if anyone can help me?!

I created a measure and would like to use the filter function to exclude future month's, however I get a 'Operator or expression '()' not supported in this context' error, the measure works without the filter function but not with it, any ideas why?

 

Thanks in advance

CSP

 

Failed_SLA = (

    calculate(DISTINCTCOUNT(Job[Id]),Job[Failed]=1)

        /

     Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=4)+Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=5)),

     Filter (JOB, MONTH(Job[Date].[Month]) <= MONTH(today()))

     )

 

 

2 ACCEPTED SOLUTIONS
Thejeswar
Super User
Super User

@CSPedrao ,

You need to modify the logic as given below

Failed_SLA = 
    calculate(DISTINCTCOUNT(Job[Id]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Failed]=1))
        /
     Calculate(DISTINCTCOUNT(Job[Number]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Status]=4))+Calculate(DISTINCTCOUNT(Job[Number]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Status]=5))

 

Regards,

View solution in original post

@Thejeswar 
It worked!!

Thanks very much for your help.

CSPedrao

 

View solution in original post

7 REPLIES 7
Thejeswar
Super User
Super User

@CSPedrao ,

You need to modify the logic as given below

Failed_SLA = 
    calculate(DISTINCTCOUNT(Job[Id]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Failed]=1))
        /
     Calculate(DISTINCTCOUNT(Job[Number]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Status]=4))+Calculate(DISTINCTCOUNT(Job[Number]),Filter (JOB, MONTH(Job[Date]) <= MONTH(today()) && Job[Status]=5))

 

Regards,

@Thejeswar 
It worked!!

Thanks very much for your help.

CSPedrao

 

@CSPedrao ,

Welcome. Kindly mark my reply as a solution! Looks like you have marked your reply as a solution.

Sorry, I've marked your your reply as solution now.

 

Thanks again!

CSPedrao

Idrissshatila
Super User
Super User

@CSPedrao ,

 

try it like this 

 

Failed_SLA = 

    calculate(DISTINCTCOUNT(Job[Id]),Job[Failed]=1)

        /

     Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=4)+Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=5)),

     Filter (JOB, MONTH(Job[Date].[Month]) <= MONTH(today()))

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




@Idrissshatila 

Hi,

It made no difference, still gives me the same message 'Operator or expression '()' is not supported in this context'.

 

Thanks anyway!

CSPedrao

@CSPedrao ,

 

try it now

 

Failed_SLA = 

    calculate(DISTINCTCOUNT(Job[Id]),Job[Failed]=1)

        /

     Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=4)+Calculate(DISTINCTCOUNT(Job[Number]),Job[Status]=5),

     Filter (JOB, MONTH(Job[Date].[Month]) <= MONTH(today())

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.