Forum Discussion

Earl40's avatar
Earl40
Helper I
1 year ago
Solved

Search then pull column data into another table

Hi I need some help, please let me know if i need to clarify my reuqest. Thank you im advamce I have 2 data sources connected. I have table A, and I want to bring in Order Date and source info from t...
  • v-ssriganesh's avatar
    1 year ago

    Hello Earl40,
    Thank you for reaching out to the Microsoft Fabric Community Forum.

    I have reproduced your scenario in Power BI Desktop based on the details you shared and I got the expected result as per your requirements.

    You wanted to bring in Order Date and Source from Table B into Table A, only if:

    • ID #, Category, and Create Date match between both tables
    • AND the Category is either A or B

    What I Did Practically in Power BI:

    • Filtered Table A to include only Category A and B
    • Performed a Merge (Inner Join) between Table A and Table B using three matching fields: ID #, Category, and Create Date
    • Expanded the required columns (Order Date and Source) from Table B into Table A

    Expected Output:


    For your reference, I’ve attached the .pbix file that demonstrates the solution using your sample data. Please feel free to download and explore it to apply the same logic in your model.

    Best Regards,
    Ganesh Singamshetty.

  • Ashish_Mathur's avatar
    Ashish_Mathur
    1 year ago

    Hi,

    Try this measure

    =if(TableA[Category]="A"||TableA[Category]="B",CALCULATE(MAX(TableB[Order Date]),FILTER(TableB,TableB[Category]=EARLIER(TableA[Category])&&TableB[ID]=EARLIER(TableA[ID]))),BLANK())