Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Data model Creation

Hi ALL

I have two tables like below

 

Table 1

 

Table 2

 

By using these two tables How can I create a data model like below image?

Final Data Model

 

Data:

 

Interview  Registration:

 

Registration DateCandidate IDNameAddressEmailPhoneExperienceDepartment
1/1/2019C1AXXXXXDE9876542kkk
1/1/2019C2BXXKLMJ34561LMN
1/2/2019C3CXXXmnMJ3564JL
1/2/2019C4DXXXCClMJ6325JL

 

Interview Round:

 

Interview DateCandidate IDRoundInterviewerResult
1/1/2019C1Tech1KLSelected
1/2/2019C1Tech2MLSelected
1/3/2019C1HRKJLSelected
1/4/2019C1FinalAAASelected
1/2/2019C2Tech1KLSelected
1/2/2019C2Tech2MLHold
1/3/2019C3Tech1KLSelect
1/4/2019C3Tech2MLRejected
  • Hi Anonymous,

     

    I would suggest you create a new table in your scenario. The slicer Candidate will be from it.

    CandidateIDs =
    DISTINCT (
        UNION ( VALUES ( Table1[Candidate ID] ), VALUES ( Table2[Candidate ID] ) )
    )
    

    Data-model-Creation2

    Data-model-Creation3

     

     

    Best Regards,

5 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Anonymous,

     

    Please download the solution from the attachment.

    Current Round =
    VAR allRound =
        CALCULATETABLE ( VALUES ( Table2[Round] ) )
    RETURN
        SWITCH (
            TRUE (),
            "Final" IN allRound, "Final",
            "HR" IN allRound, "HR",
            "Tech2" IN allRound, "Tech2",
            "Tech1" IN allRound, "Tech1",
            BLANK ()
        )
    
    Current Result =
    LOOKUPVALUE (
        Table2[Result],
        Table2[Round], [Current Round],
        Table2[Candidate ID], [Candidate ID]
    )
    
    Tech1 =
    LOOKUPVALUE (
        Table2[Result],
        Table2[Candidate ID], [Candidate ID],
        Table2[Round], "Tech1"
    )
    
    Tech2 =
    LOOKUPVALUE (
        Table2[Result],
        Table2[Candidate ID], [Candidate ID],
        Table2[Round], "Tech2"
    )
    
    HR =
    LOOKUPVALUE (
        Table2[Result],
        Table2[Candidate ID], [Candidate ID],
        Table2[Round], "HR"
    )
    
    Final =
    LOOKUPVALUE (
        Table2[Result],
        Table2[Candidate ID], [Candidate ID],
        Table2[Round], "Final"
    )
    

    Data-model-Creation

     

    Best Regards,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks v-jiascu-msft

       

      in the data model, I want to update Table 2 (Interview Round) like below image 

      I want to add the registered date in this table, then only I can complete my requirement

       

      Requirement

      1. How many candidates registered on the selected date? and drill down to their personal information and interview result 
      2. How many candidates attend the interview on the selected date? and drill down to their personal information and interview result 

      How can i achieve this logic? please give some idea to complete this requirement 

       

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Microsoft Employee

        Hi Anonymous,

         

        These data is in Table 1. Why would you like to add them in Table 2? I would suggest you keep the model simple and clear.

        You need to add a date table. Then you can solve the two questions using measures.

         

        Best Regards,