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
Varinder
Regular Visitor

Use of curly brackets in If formula

Hello Community

 

I was trying to use the Excel formula IF(AND(M7="GP01",AI7<>""),"",IF(OR(D7={"Q1",""},M7={"GV01","GL02","GL03","GL07","GF01"}),"",1))

in DAX where curly brackets showing error "A table of multiple values was supplied where a single value was expected."

 

What are the other ways to use the same formula in DAX?

@TomMartens @amitchandak 

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Varinder ,

 

For this you need to use the in statement rewrite the measure has:

IF(AND(M7="GP01",AI7<>""),"",IF(OR(D7 in {"Q1",""},M7 in {"GV01","GL02","GL03","GL07","GF01"}),"",1))

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

TomMartens
Super User
Super User

Hey @Varinder ,

you might try to replace this

M7={"GV01","GL02","GL03","GL07","GF01"}

with this

M7 IN {"GV01","GL02","GL03","GL07","GF01"}

Use th IN operator if a certain value is one of many values.

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @Varinder ,

you might try to replace this

M7={"GV01","GL02","GL03","GL07","GF01"}

with this

M7 IN {"GV01","GL02","GL03","GL07","GF01"}

Use th IN operator if a certain value is one of many values.

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
MFelix
Super User
Super User

Hi @Varinder ,

 

For this you need to use the in statement rewrite the measure has:

IF(AND(M7="GP01",AI7<>""),"",IF(OR(D7 in {"Q1",""},M7 in {"GV01","GL02","GL03","GL07","GF01"}),"",1))

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.