cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cypher294
Frequent Visitor

IF Condition multiple valiues ( without querie editor )

Hello, just have a short question. I am trying to seperate the age of tickets between three different dimensions >5 days >60 days and all the other.

 

I am Using an if condition:

 

TicketAge = IF(Test[WorkDay Count]>5;"Ticket older 5 Days";IF(Test[WorkDay Count]>60;"Ticket older 60 Days";"No Violation"))

 

The unexpected output is that within the visualization the tickets " no vioaltions " and " older 5 days" are shown but the criteria with 60 days will be skipped.

 

I can' use the querie editor for this because of the column " WorkDay Count" is already a calculated one which is not present within the query editor. All other hints I'Ve already checked are if conditions segmented by "," instead of ";" but this is not working and comes up with syntax error messages.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
jthomson Solution Sage
Solution Sage

Re: IF Condition multiple valiues ( without querie editor )

You need to change the order your IF statement looks at the data - anything that's more than 60 days is, by definition, more than 5 days and will be flagged as more than 5 days first. Try swapping the 60 days and 5 days bits of the statement.

View solution in original post

2 REPLIES 2
Highlighted
jthomson Solution Sage
Solution Sage

Re: IF Condition multiple valiues ( without querie editor )

You need to change the order your IF statement looks at the data - anything that's more than 60 days is, by definition, more than 5 days and will be flagged as more than 5 days first. Try swapping the 60 days and 5 days bits of the statement.

View solution in original post

Moderator v-yuezhe-msft
Moderator

Re: IF Condition multiple valiues ( without querie editor )

@Cypher294,

Use the following DAX instead and check if you get expected result.

TicketAge = IF(Test[WorkDay Count]>5 && Test[WorkDay Count]<=60;"Ticket older 5 Days";IF(Test[WorkDay Count]>60;"Ticket older 60 Days";"No Violation"))

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors