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

3 column value check to get status

Hi,

 

I am trying the below formula to get SLA status by checking values from 3 columns.

 

SLA_Status = IF( AND('Data'[04.OpenClosed_Staus]="Closed",AND(AND('Data'[Status]="Completed in Data Entry",'Data'[Status]="Rejected"),'Data'[03A.DFM_Ageing_Calc]>3)),"Dependency",blank())

 

Not getting any row having final values as "Dependency". Is the formula correct or can anyone help me on this?

 

Murali

 

2 ACCEPTED SOLUTIONS

Replace the "AND" statement with an "OR" statement when checking the status.

 

Before:

SLA_Status = 
IF(
	AND(
		'Data'[04.OpenClosed_Staus]="Closed",
		AND(
			AND(
				'Data'[Status]="Completed in Data Entry",
				'Data'[Status]="Rejected"
			),
			'Data'[03A.DFM_Ageing_Calc]>3
		)
	),
	"Dependency",
	blank()
)

After:

SLA_Status = 
IF(
	AND(
		'Data'[04.OpenClosed_Staus]="Closed",
		AND(
			OR(
				'Data'[Status]="Completed in Data Entry",
				'Data'[Status]="Rejected"
			),
			'Data'[03A.DFM_Ageing_Calc]>3
		)
	),
	"Dependency",
	blank()
)

 

View solution in original post

Anonymous
Not applicable

Thanks Drewlewis. It worked.

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

You have a logical impossibility in your formula. Your formula, written so that it is readable is:

 

SLA_Status = 
IF(
	AND(
		'Data'[04.OpenClosed_Staus]="Closed",
		AND(
			AND(
				'Data'[Status]="Completed in Data Entry",
				'Data'[Status]="Rejected"
			),
			'Data'[03A.DFM_Ageing_Calc]>3
		)
	),
	"Dependency",
	blank()
)

It is a logical impossibility that your 'Data'[Status] field could ever have a value of "Completed in Data Entry" AND "Rejected".

 

It is often the case that good formatting makes problems obvious. Use Alt-Enter for new lines and tabs in the DAX editor to make things readable.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Is there any other posibilities on this logic?

Anonymous
Not applicable

Enclosed is the data sample. Need to get the SLA status column by Dax formula.

 

04.OpenClosed_Staus                Status                 Ageing    SLA status
Closed                        Completed in Data Entry    >3          Dependency
Closed                        Completed in Data Entry    0-3         Met
Closed                        Completed in Workflow     >3          Miss
Closed                        Completed in Workflow     0-3         Met
Closed                        Rejected                             >3          Dependency
Closed                        Rejected                             0-3         Met
Closed                        Rejected from Workflow    >3          Miss
Closed                        Rejected from Workflow    0-3         Met

 

Replace the "AND" statement with an "OR" statement when checking the status.

 

Before:

SLA_Status = 
IF(
	AND(
		'Data'[04.OpenClosed_Staus]="Closed",
		AND(
			AND(
				'Data'[Status]="Completed in Data Entry",
				'Data'[Status]="Rejected"
			),
			'Data'[03A.DFM_Ageing_Calc]>3
		)
	),
	"Dependency",
	blank()
)

After:

SLA_Status = 
IF(
	AND(
		'Data'[04.OpenClosed_Staus]="Closed",
		AND(
			OR(
				'Data'[Status]="Completed in Data Entry",
				'Data'[Status]="Rejected"
			),
			'Data'[03A.DFM_Ageing_Calc]>3
		)
	),
	"Dependency",
	blank()
)

 

Anonymous
Not applicable

Thanks Drewlewis. It worked.

drewlewis15
Solution Specialist
Solution Specialist

I would create a custom column using the query editor.  The structure of the statement using M would be:

 

if COLUMN1 = value1 and COLUMN2 = value2 and COLUMN3 = value3 then "Dependency" else null

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.