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

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
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

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.

View solution in original post

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

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.

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.