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
dcg38524
Helper III
Helper III

DAX script not equal rejection

Hello,

I need your help, I've attempted to write a DAX script to match first 3 lines "HPI" within a column which meets criteria major_incident_state = "Accepted" but not equal <> "Rejected"(see below).

 

Unfortunately, my DAX version does not work i.e. not to include "Rejected".

 

Any help or suggestion is welcome.

 

Thank you in advance,

 

 

MI State = 

IF( 'MajorIncidentTickets_2022-23'[major_incident_state] = "Accepted" && 
   LEFT('MajorIncidentTickets_2022-23'[short_description],3) = "HPI" && 'MajorIncidentTickets_2022-23'[major_incident_state] <> "Rejected", 
     "HPI", "MI"
  )

 

 

1 REPLY 1
Anonymous
Not applicable

Hello,

 

try wrapping your columns in a selectedvalue, since you have to tell DAX that it needs to look at the value on every row. You then also do not need to specify to exclude "Rejected" since you are using the && operator:

 

MI State = 

IF( SELECTEDVALUE('MajorIncidentTickets_2022-23'[major_incident_state]) = "Accepted" && 
   LEFT(SELECTEDVALUE('MajorIncidentTickets_2022-23'[short_description]),3) = "HPI", 
     "HPI", "MI"
  )

 

 
Hope this was the solution.

 

 

Best Regards,

Max

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