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

Practice Exam Question, I think is incorrect answer

Here is the question and answer they say is slicer:  I think is is the Second one down.  Can you tell me what you think?

 

As part of a large HR project you are working with a dataset of company employees, both past and present. The data includes columns for EthnicGroup, PayTypeID, HireDate (the date they started work), TermDate (the date they left) and several other columns. You want to create a new Calculated Column that determines if the person was a bad hire based on a set of rules. If they were a bad hire then the result is 1, otherwise the Calculated Column displays a zero.

The bad hire rule is:

BadHire = If the person stayed at the company less than 61 days

Example: If a person joined the company on 27th June 2013 and left on 21st August 2013, then they would be a bad hire.

Which DAX expression would you use for this Calculated Column?
Slicer
IF(OR((([HireDate]-[TermDate])) >= 61,ISBLANK([TermDate])),0,1)
IF(((([HireDate]-[TermDate])*-1) < 61),1,0)
IF((([TermDate]-[HireDate])*-1) >= 61,0,1)
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Practice Exam Question, I think is incorrect answer

Hi @suzanneshuford,

 

By my test, the second formula should be right based on the three formulas.

 

However, I think the below forumula will be better based on your requirement.

 

Column =
IF (
    OR (
        DATEDIFF ( 'Table1'[HireDate], 'Table1'[Termdate], DAY ) >= 61,
        ISBLANK ( 'Table1'[Termdate] )
    ),
    0,
    1
)

result.PNG

 

Hope this can help you.

 

Best  Regards,

Cherry

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

Re: Practice Exam Question, I think is incorrect answer

Hi @suzanneshuford,

 

By my test, the second formula should be right based on the three formulas.

 

However, I think the below forumula will be better based on your requirement.

 

Column =
IF (
    OR (
        DATEDIFF ( 'Table1'[HireDate], 'Table1'[Termdate], DAY ) >= 61,
        ISBLANK ( 'Table1'[Termdate] )
    ),
    0,
    1
)

result.PNG

 

Hope this can help you.

 

Best  Regards,

Cherry

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