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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors