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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

DAX Syntax Error

HI All, 

I am having an Issue to generate this code

there are some syntax error that I cant ping, 

 

Data = SWITCH(TRUE() , MAX(SC[C]) = "Tl",[MTl]
,AND(MAX(SC[]C) = "PR", AND(MAX (SC[s]) = "PR" ), [MPR],
,AND(MAX (SC[C]) = "MPA" , AND(MAX(SC[s]) = "MPA" ), [MPA]
,"")))

 

any help appriciate it please 

 

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

Try the following:

 

Data = SWITCH(TRUE() , MAX(SC[C]) = "Tl",[MTl]
,AND((MAX(SC[C]) = "PR")  , (MAX(SC[s]) = "PR"  )), [MPR],
,AND((MAX(SC[C]) = "MPA") , (MAX(SC[s]) = "MPA" )), [MPA]
,"")

View solution in original post

5 REPLIES 5
themistoklis
Community Champion
Community Champion

Try the following:

 

Data = SWITCH(TRUE() , MAX(SC[C]) = "Tl",[MTl]
,AND((MAX(SC[C]) = "PR")  , (MAX(SC[s]) = "PR"  )), [MPR],
,AND((MAX(SC[C]) = "MPA") , (MAX(SC[s]) = "MPA" )), [MPA]
,"")
Anonymous
Not applicable

@themistoklisThanks , error gone, cheers

@themistoklis the error is gone but I just came a cross another issue/error:

this above meaure uses multiple measures from other datasets

and on my other meaure which returen stings value I am using 

PR = CALCULLATE(SUM(viewName[pq) = "N"]

 

this is string and I belive cant use CAL SUM?

what would I use ?

 

and 

 

 PR = CALCULATE(COUNT(viewName[A]),viewName[P]) ="N"

 

first value is numver and second is string 

thanks 

 

 

 

Anonymous
Not applicable

could anyome help pls?

Anonymous
Not applicable

Hi , 

 

Yes there are syntax errors in your code but its hard to repair without knowing what you are trying to do, 

 

Could you send some sample data and explain ?

Anonymous
Not applicable

Hi thanks for respond ,
I am a little restricted to provide data , but this is to creat a waterfall chart , it has been done before but when I changed column/ measure names it gives syntax error 😞

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors