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
law_90
New Member

Returning value from Table A if Table B condition meet Table A

Hi all,

 

I am new to PowerBI and currently developing some dashboard by facing some issue.

I have 2 tables - namely historical_data and current_weekly_data

The historical_data consist of 3 columns, Issue Name, Open Date and Status shown below:

law_90_0-1678154909677.png

 

The current_weekly_data will only consist of 1 column - Issue Name.

law_90_1-1678154955054.png

 

What I wanted to achieve is to create the Open Date and Status calculated column in current_weekly_data table to achieve the following:

law_90_2-1678155007826.png

 

I know this can be done using Merge in Power Query but the data is huge and having slowness in performance when doing that and hence I would request for some guidance in doing this using DAX.


I have no idea how can I retrieve the value from historical_data table to be inserted into the current_weekly_data table if the issue name match.. any help would be very much appreciated.

 

Thank you!

 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@law_90 , You can create a new column in dax like

 

in current week table =

var _cnt = countx(his, his[issue Name] = curr[Issue Name] && his[Open Date] < curr[Open date]), his[Issue name])

return

if(not(isblank(_cnt)), "Remain", "Newly Added")

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

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.

Top Solution Authors