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
Anonymous
Not applicable

dax QUERY WORKING WEIRDLY

Hi all

I have the following query, its not working for "PRESSURE", However, if I create a separate query for the same its working.

I am not getting any error message either.

 
Column =
SWITCH(TRUE(),AND([SAPACTDES-3]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-4]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-5]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-6]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-7]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-3]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-4]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-5]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-6]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-7]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-3]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-4]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-5]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-6]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-7]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"),"OTHER EQUIPMENT")
4 REPLIES 4
wdx223_Daniel
Super User
Super User

@Anonymous think it might be that swith function can not reach that step because previous conditions has got a True, or the combinations not be listed completely.

amitchandak
Super User
Super User

@Anonymous , Other one misplace of parenthesis at last every thing else seems fine.

Can you share a sample pbix after removing sensitive data.

 

SWITCH(TRUE(),AND([SAPACTDES-3]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-4]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-5]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-6]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-7]="VESSEL",[SAPACTDES-2]="EXT"),"EXT-VESSEL"
,AND([SAPACTDES-3]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-4]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-5]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-6]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-7]="SEPARATOR",[SAPACTDES-2]="EXT"),"EXT-SEPARATOR"
,AND([SAPACTDES-3]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-4]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-5]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-6]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE"
,AND([SAPACTDES-7]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE","OTHER EQUIPMENT")
Anonymous
Not applicable

The query was working fine, i had confused myself.

Fowmy
Super User
Super User

@Anonymous 

I didn't get your question right, please explain clearly.

Your last line closing bracket before "OTHER EQUIPMENT" is not required.

,AND([SAPACTDES-7]="PRESSURE",[SAPACTDES-2]="EXT"),"EXT-PRESSURE","OTHER EQUIPMENT")

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.

Top Solution Authors