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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sophtee
Frequent Visitor

Lookup column for filtered data

Hello everyone,

I have 2 tables in Power BI.

However when I created 2 reports (from the 2 separate tables), I would like to look up from a list of filtered data and fill in the other table:

sophtee_1-1708966131776.png

Age1 = LOOKUPVALUE('FHL-Tray Data'[Ageflk],'FHL-Tray Data'[Flk#],'podndatabasetable (2)'[Flock1])
Below shows the 2 tables which are both filtered tables. Is there a way to fix this column or can I create a flow to add this data to excel?
sophtee_2-1708966313726.png

 

 

 

2 ACCEPTED SOLUTIONS
barritown
Super User
Super User

Hi @sophtee,

This piece of code should help you:

barritown_0-1708976711944.png

In plain text:

Age1 = 
VAR currentFlock = [Flock1]
RETURN MAXX ( FILTER ( T2, [Flk#] = currentFlock ), [Ageflk] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

View solution in original post

v-yaningy-msft
Community Support
Community Support

Hi, @sophtee 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1709172370477.png

Measure:

 

Age1 =

LOOKUPVALUE ( Table2[Agefilk], Table2[Flk#], Table1[Flock1] )


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @sophtee 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1709172370477.png

Measure:

 

Age1 =

LOOKUPVALUE ( Table2[Agefilk], Table2[Flk#], Table1[Flock1] )


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

barritown
Super User
Super User

Hi @sophtee,

This piece of code should help you:

barritown_0-1708976711944.png

In plain text:

Age1 = 
VAR currentFlock = [Flock1]
RETURN MAXX ( FILTER ( T2, [Flk#] = currentFlock ), [Ageflk] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.