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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sflynn
Helper I
Helper I

Create Dynamic Lookup between Unrelated tables

I have two data table, one with pricing listed out by tour and date (package price) and another data table with pricing listed out by airport and  date range (Air Price). There is currently no relationship between the tables as the relationship woud be many to many. I currenty have a formula in the in the package price table that returns the air rate for the corresponding tour and date. However, I need the formula to return air pricing based on a specific gateway as well as the tour and date. The package price table does not have any gateway information, but I did create a third table with just a list of airports. Is there any way to write a dax formula that would not only match the corresponding tour/date from the package price table but also the airport based on the filter selection from the list of airports?

5 REPLIES 5
sflynn
Helper I
Helper I

Thank you for your responces, please see the example snapshots of the data tables below:Example Air Price Date Table.pngExample Package Price Data Table.pngReport.png

v-xicai
Community Support
Community Support

Hi @sflynn ,

 

You may create column or measure to get matched items using RELATED function, LOOKUPVALUE function, or FIRSTNONBLANK function .

 

For example:

 

Column1=RELATED([one side field of relationship])

 

Column1= LOOKUPVALUE(tableA[goal field],  tableA[linked field],  tableB[linked field])) 

 

Column1= CALCULATE (FIRSTNONBLANK ( tableA[goal field], 1 ),FILTER ( ALLSELECTED( tableA), tableA[linked field] = tableB[linked field] ))

 

Or could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Example Air Price Date Table.pngExample Package Price Data Table.pngReport.png

parry2k
Super User
Super User

@sflynn can you past some sample data for each table and expected output. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Example Air Price Date Table.pngExample Package Price Data Table.pngReport.png

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.