Forum Discussion

Kumarun's avatar
Kumarun
Helper I
3 years ago

lookup values

Hi, folks,

I have two tables Table1 and Table 2

I need the start_date and end date from Table 2 so here I just mapped with emp_id = emp_id, so I'm getting the results like this. it's taking first-entry records only because I'm using the first nonblank function.

NOTE: Emp_id column is only possible for mapping 

 
I need the output like below




2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Kumarun Sorry, having trouble following, can you post sample data as text and expected output?
    Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

    • Kumarun's avatar
      Kumarun
      Helper I

      EMPLOYEE INFO PA0001 TABLE

      VISA_IDSTART DATEEND DATE
      15706-12-2231-12-22
      15701-01-2331-12-99
      15801-12-202131-12-2022

       Here single employee has two records and different start date and end date so i need start date and end date column from this table to emp visa request table so by using the below formula 

      formula: = CALCULATE(
      FIRSTNONBLANK(
      Employee_info_pa0001[start_date],1),
      FILTER(
      ALL(Employee_info_pa0001),Employee_info_pa0001[emp_id]=Emp_Visa_Request[visa_requester_id]))

      getting the results like below 
      EMP VISA REQUEST TABLE

      visa_idstart dateend date
      15706-12-2231-12-22
      15706-12-2231-12-22
      15706-12-2231-12-22
      15706-12-2231-12-22
      15801-12-202131-12-2022


      In the main table single employee has one record or morethan one record but here it is picking the first entry date only not all the date. so i need all the dates how can i get it?


      output

      VISA_IDSTART DATEEND DATE
      15706-12-2231-12-22
      15701-01-2331-12-99
      157  
      157  
      15801-12-202131-12-2022


      in the output need all the dates from main table but the issue is i have only employee column for maping there is no other column to getting different dates.