Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dataprofile
New Member

Retrieve count of candidates based on criteria.

Hi! 

I have a table(candidates_table) with candidate id, application id and candidate stage. The table looks as follows: 

candidate_id      | application_id      | Candidate_stage

1                          CAND-1                  Interview

1                          CAND-1                  Offer

1                          CAND-1                  Ready for Hire

2                          CAND-2                  Interview

2                          CAND-2                  Offer

I'm trying to create dax code to retrieve the distinct count of candidates that made it to the Candidate Stage "Offer" but didn't make it to the "Ready for Hire" stage (in this case the count would be 1=candidate 2). Any ideas would be appreciated! Thanks!

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1665105244505.png

 

For fun only, a showcase of powerful Excel worksheet formula; btw, I'm just got hired with decent salary by a big company for my proficiency in Excel.🤣

CNENFRNL_1-1665107210121.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
MahyarTF
Memorable Member
Memorable Member

Hi,

You could create the 2 separate tables for the Offer and Ready for Hire separately :

1- 

OfferTable = CALCULATETABLE(
                            SELECTCOLUMNS(sheet228,
                                          "Candidate_Id", Sheet228[candidate_id],
                                          "Application_Id", Sheet228[application_id]),
                           Sheet228[Candidate_stage] = "Offer")
2- 
ReadyforHireTable = CALCULATETABLE(
                            SELECTCOLUMNS(sheet228,
                                          "Candidate_Id", Sheet228[candidate_id],
                                          "Application_Id", Sheet228[application_id]),
                           Sheet228[Candidate_stage] = "Ready for Hire")
And then create a measure in your main table as below : 
CandOffer =
Var result = COUNTROWS(OfferTable) - COUNTROWS(ReadyforHireTable)
return result
- Now you have the Candidate separately and the count you mentioned in your post.
Thanks for your Kudos
Please mark it as solution if it helps you
Mahyartf
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1665105244505.png

 

For fun only, a showcase of powerful Excel worksheet formula; btw, I'm just got hired with decent salary by a big company for my proficiency in Excel.🤣

CNENFRNL_1-1665107210121.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.