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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How to retrieve value between two tables based on multiple slicer values

I am trying to work on a scenario where I have two tables and I need to look up in table2 based on multiple slicer values coming from one table. Below are the details and your inputs are highly appreciated -

 Capture.JPG

  

The slicers will be on CompanyCode, To Currency, Rate type, date.

 

CompanyCode can be multiple selected values, and each company code will have one asscociated FromCurrency value and rest all slicers will be single select values. I don’t have a relationship between these two tables. I need to look up for a exchange rate on table2 and multiply revenue on table 1 with the exchange rate retrieved from table 2 based on slicer values.  

Basically how it works is for example - if two  company codes are selected in slicer, then we need to look up on table 2 using the two FromCurrency values that are filtered down on table 1 as each companycode will be associated with one FromCurrencyValue.

 

Right now I am able to achieve it if only one companycode is selected using below measure where I am filtering the table down to each selected value in slicer. Selected values are calculated as different measures and provided as input in below query exchangeRateCalculate -

SelectedRateType = SELECTEDVALUE(TABLE2[rate_type])

 

exchangeRateCalculate = CALCULATE(VALUES(TABLE2[exch_rate]),CALCULATETABLE(TABLE2,FILTER(TABLE2,TABLE2[fromcurrency] = [SelectedFromCurrency]) ,TABLE2[tocurrency] in VALUES(TABLE2[tocurrency]),TABLE2[rate_type] in VALUES(TABLE2[rate_type]),FILTER(TABLE2,TABLE2[rateeffectivefromdate] <= [SelectedDate] && TABLE2[rateeffectivetodate] >= [SelectedDate])

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@v-lili6-msft thanks for looking into it. My file is so large to share and I got what I wanted anyway. I was able to select multiple and filter by companycodes using AllSelected function modfiying my exisitng DAX

 

exchangeRateCalculate =

var Exch = CALCULATE(Sum(TABLE2[exch_rate]), table1(companycode in allselected (table1[Companycode]),

TABLE2[fromcurrency] in values (table1[fromcurrency] ,TABLE2[tocurrency] in VALUES(TABLE2[tocurrency]),TABLE2[rate_type] in VALUES(TABLE2[rate_type]),FILTER(TABLE2,TABLE2[rateeffectivefromdate] <= [SelectedDate] && TABLE2[rateeffectivetodate] >= [SelectedDate])

return exch

 

 

 

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

Could you please share us your sample pbix file or some sample data and the expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-lili6-msft thanks for looking into it. My file is so large to share and I got what I wanted anyway. I was able to select multiple and filter by companycodes using AllSelected function modfiying my exisitng DAX

 

exchangeRateCalculate =

var Exch = CALCULATE(Sum(TABLE2[exch_rate]), table1(companycode in allselected (table1[Companycode]),

TABLE2[fromcurrency] in values (table1[fromcurrency] ,TABLE2[tocurrency] in VALUES(TABLE2[tocurrency]),TABLE2[rate_type] in VALUES(TABLE2[rate_type]),FILTER(TABLE2,TABLE2[rateeffectivefromdate] <= [SelectedDate] && TABLE2[rateeffectivetodate] >= [SelectedDate])

return exch

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.