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
tim10
Helper I
Helper I

Lookup value based on slicer

Hello,

 

I have 2 tables with a relationship as marked below with a red line. The green table has some special exchange rates. The second table has exchange rates by month. 

ExchRate is simply a column with the formula =RELATED('Green Table' [ERspecial]).

Basically, for each ERYear in table 2, I am attaching this special Exchange Rate called ERSpecial.

No problem so far

A new ask has been introduced:

a) Add a slicer with values 2022 and 2023

b) If the user selects 2023 in the slicer, attach ERspecial with ERyear 2023 to every single record in table 2.

c) If the user selects 2022 in the slicer, attach ERspecial with ERyear 2022 to every single record in table 1.

 

I am struggling to make this work. Could you please guide me? Ideally, i want this to be a column. Thank you

 

table 2.png

2 REPLIES 2
amitchandak
Super User
Super User

@tim10 , Create a measure

maxx(filter( Rate, Rate[COde] = max(Table[Code])  && Rate[ERYear] = [selected Year]) , [ERSpecial])

Thank you for your reply. I did what you said but it only returns values for the selected year in the slicer. The other years are filtered out. Please see below. I am expecting that yearly exchange rate to be attached to every single row in the monthly exchange rate table, based on the slicer selection.

Basically, if selected value in the slicer is 2023, every single row in the monthly exchange rate should get the ERspecial for 2023 and so on. have a nice day

 

exce.png

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.