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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Steuben
New Member

DAX: Operator or expression '( )' is not supported in this context

I'm trying to make a measure to help me with some conditional formatting. Sadly, I'm running into a new error for me when trying to be fancy with some nested IFs. I know there's a way to do this, but for the life of me I can't figure it out! When I use the below code I get the following error message: "Operator or expression '( )' is not supported in this context". 

 

Inverse_ind_formatting =
IF([Inverse_ind_measure] = 1 && ('Compare_Monthly Extracts_Data'[Rate_Variance] < 0,[Rate_Variance] >-99999),-1,
IF([Inverse_ind_measure] = 1 && ('Compare_Monthly Extracts_Data'[Rate_Variance] <0.05,[Rate_Variance]>0),-2,
IF([Inverse_ind_measure] = 1 && ('Compare_Monthly Extracts_Data'[Rate_Variance]<0.1,[Rate_Variance]>0.05),-3,
IF([Inverse_ind_measure] = 1 && ([Rate_Variance]<99999,[Rate_Variance]>0.1),-4))))
1 ACCEPTED SOLUTION
ToddChitt
Super User
Super User

You have and extra ( at the start of this:

('Compare_Monthly Extracts_Data'[Rate_Variance] < 0,[Rate_Variance] >-99999)

 

Try formatting with tabs:

IF ( <Condition 1>, <true>,

       IF (<condition 2>, <true>, 

           IF ( <condition 3>, >true>, <false> )

       )

 )

 

That helps line up the ( and the )




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
ToddChitt
Super User
Super User

You have and extra ( at the start of this:

('Compare_Monthly Extracts_Data'[Rate_Variance] < 0,[Rate_Variance] >-99999)

 

Try formatting with tabs:

IF ( <Condition 1>, <true>,

       IF (<condition 2>, <true>, 

           IF ( <condition 3>, >true>, <false> )

       )

 )

 

That helps line up the ( and the )




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





That sure did the trick, thank you!! I had those extra () in there because a few iterations ago I was messing around with using AND...but I forgot to remove that and replace it with some more &&. Here's the final code I used that ended up working beautifully. I did do the tabs I swear, I just isn't coming through nicely when I paste it.

 

Inverse_ind_formatting =
IF([Inverse_ind_measure] = 1 && 'Compare_Monthly Denodo Extracts_Data'[Rate_Variance] < 0 && [Rate_Variance] >-99999,-1,
IF([Inverse_ind_measure] = 1 && 'Compare_Monthly Denodo Extracts_Data'[Rate_Variance] <0.05 && [Rate_Variance]>0,-2,
IF([Inverse_ind_measure] = 1 && 'Compare_Monthly Denodo Extracts_Data'[Rate_Variance]<0.1 && [Rate_Variance]>0.05,-3,
IF([Inverse_ind_measure] = 1 && [Rate_Variance]<99999 && [Rate_Variance]>0.1,-4))))

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors