# apply function for specific element DAX

##### New Member
Hello!, Please I ask fro support in applying function for specific element DAX.

I Have a column called LOB, contains 11 elements "Criteria"

 LOB Business Golden Customers NC Reapers TEData-Sales TEData-Sales "Subscription" WE Xceed-UP Q Xceed-Basic Xceed-Sales

<tbody>
</tbody>

I need to create a measure called AHT, but to be specified based on LOB, e.g

For Below LOBs I need to Use measure: AHT:=(((([Sum of ACD Time]+[Sum of ACW Time]+[Sum of Hold Time])-[Sum of ACWOUTOFFTIME])/86400)/[Sum of ACD Calls])

 Business Golden Customers NC Reapers TEData-Sales TEData-Sales "Subscription" WE

<tbody>
</tbody>

but for below LOBs I need to apply this function to the same measure

AHT:=((([Sum of ACD Time]+[Sum of ACW Time]+[Sum of Hold Time])/86400)/[Sum of ACD Calls])

 Xceed-UP Q Xceed-Basic Xceed-Sales

<tbody>
</tbody>

Last edited:

#### FranzV

##### Board Regular
You can solve this using a Lookup Table and a Calculated Column. Try the following steps:

• Add a table to your data model with LOB values that require the first measure.
• I will call it FirstMeasureCriteria and it only has one column: LOB.
• Add a calculated column to your original table called RequiresFirstMeasure with the formula:
• = CONTAINS( FirstMeasureCriteria , FirstMeasureCriteria[LOB] , YourTable[LOB] )
• This will return TRUE if the LOB in the current row context can be found in the lookup table.
• Create one measure for each different calculation and name them FirstAHT and SecondAHT.
• Create the AHT measure that chooses between the two:
• AHT:= IF( VALUES( YourTable[RequiresFirstMeasure] ) , [FirstAHC] , [SecondAHC] )

I hope it helps.

1,082,342
Messages
5,364,777
Members
400,815
Latest member
gangstar67

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...