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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
unnijoy
Post Partisan
Post Partisan

Lookup

Data Table.png

 

i have 2 tables. one is Active HC and other is Inactive HC.

In Inactive HC i don't have L2 name. but it is available on Active HC table. i need to find it based on the below logic.

 

Logic- From inactive table we have to take the Empid and go to active Active table. And apply 2 filter. 

Fiter 1 =first we have to get the previous month of the report date which is mentioned in Inactive ( in our case previous months based on Inactive is Jan - 1 - 2021.)

Filter 2 = In Active table filter for "Opening"

so based on the above table i will go to Inactive table and take the EMPID 122. and the Report date is Feb - 1- 2021 ( In Inactive Table). now i have to go to Active table and first filter is previous month. so i will select Jan-1-2021( Active Table). and Filter 2 is "Opening" ( Active Table). and it will give me L2 as Jack.

 

How to get this working

 

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@unnijoy 

pls try this

L2 = 
MAXX(FILTER(ALL(Active),Active[Report Name]=EDATE(Inactive[Report Name],-1)&&Active[OP/CL]="Opening"&&Active[EMPID]=Inactive[EMPID]),Active[L2])




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
ryan_mayu
Super User
Super User

@unnijoy 

pls try this

L2 = 
MAXX(FILTER(ALL(Active),Active[Report Name]=EDATE(Inactive[Report Name],-1)&&Active[OP/CL]="Opening"&&Active[EMPID]=Inactive[EMPID]),Active[L2])




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




hi @ryan_mayu 

 

thanks a Lot. its working.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@unnijoy ,

Create a new table from Table one if it has all emp

 

summarize(table, Table[empid], table[L2])

 

Join it both the tbale on employee id

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

hi @amitchandak ,

 

Thanks for your reply.

 

I need to create a calulated column for L2. like a lookup based on filter. Can you please help me with that.

@unnijoy , a new column in inactive 

 

maxx(filter(active , active[empid] = inactive[empid]), active[l2]) 

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak  in the above dax i think we forgot to add the other two filter, one is select only opening in Active and second is we have to select the previous month of the report date in Inactvie and based on the previous month we have to lookup from Active. 
that means if in Inactive table the report date is Feb - 1- 2021 then we have to select Jan -1 -2021 in Active table and filter only Opening and then based on the EMPID we have to select the L2 from Active.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.