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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Fetch data from RelatedTable and Selected Column

I have 4 tables linked as follows:

  • Tab_sales and tab_Entity: 1 to many relationship (one side from tab_Entity) using column Entity
  • Tab_Entity and Tab_forex: a many-to-many relationship using column CURRENCY
  • Tab_forex and Tab_scenario: 1 to many relationship (one side from tab_scenario) using column Scenario
  • Tab_scenario_forex: 1 to many relationship (1 side from tab_scenarioForex) using column Scenario

 

I'd like to create a calculated column in Tab_Entity fetching the value Ex. rate from tab_Forex, changing based on the value selected from tab_scenario, so that I can choose the exchange rate I want to use for Sales (either ACT or Plan).

 

I tried this way creating a calculated column in tab_Entity:

forex = CALCULATE (SUMX('Tab_forex', 'Tab_forex'[Ex rate]),

RELATEDTABLE(Tab_Forex)

 

but the results is not filtered by Scenario from tab_Scenario_forex

Anybody can recommend a solution?

 

Thanks a lot

Mark

 

 

Tab_sales

EntitySales
USA100000
Mexico3000
Italy2500
France5000
Germany2000
France700
USA20000
Mexico5000

 

 

 

Tab_Entity

 

EntityCurrency
USAUS$
MexicoMXN
FranceEUR
GermanyEUR
ItalyEUR
SpainEUR

 

 

Tab_forex

 

CurrencyScenarioEx. rate
EURACT0.9
EURPlan0.8
US$ACT1
US$Plan1
MXNACT25
MXNPlan24

 

Tab_Scenario_Forex

 

Scenario
Plan
ACT
1 ACCEPTED SOLUTION

@Anonymous ,

 

I've changed the file. Please check it.  Download PBIX 

 

I've include the ex.rate in the Sales table.

 

Ricardo



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

Proud to be a Super User!



View solution in original post

3 REPLIES 3
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Please, check if it's what you want: Download PBIX 

 

Ricardo



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

Proud to be a Super User!



Anonymous
Not applicable

Hi Ricardo,

 

many thanks for this.

The problem is still there: even if I select either ACT or Plan from the filter Scenario, the amount of sales doesn't change. The target is to have different amount of sales depending on the selected exchange rate scenario

 

Mark

@Anonymous ,

 

I've changed the file. Please check it.  Download PBIX 

 

I've include the ex.rate in the Sales table.

 

Ricardo



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

Proud to be a Super User!



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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