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
sahubibhuti45
Frequent Visitor

Getting a row level operation by using two different tables

Hi Folks,

 

I have 2 tables like

Loan
Party namecurrencydateorg_amount
johnusd15th jan

30

joyusd16th jan40
chandleraud20th jan20
monikaeur14th feb40
phoebedin20th feb20

 

another table having 

Currency History 
Datecurrencyconversion amount
20th janusd81
20th janaud84
20th jandin82
20th janeur84
21st janusd87
21st janaud83
21st jandin81
21st janeur84
22nd janusd92
22nd janaud85
22nd jandin82
22nd janeur84

 

I wanted to give a date slicer as an input date from the rate history table i.e. 2nd table and want to calcualte the amount by multiplying the org_amount * conversion rate for each party. I have tried joining both the tables but i am getting huge number of rows.

 

whated to get an output like this. based on user input date

Loan
Party namecurrencydateorg_amountorg_amount * conversion amount

 Thanks

7 REPLIES 7
Daniel29195
Super User
Super User

@sahubibhuti45 

the calculation should be base on the currency =  currenct and date  = date ? 

Hi @Daniel29195 ,Date is from 2nd table because the values are varying and we need to chhose a date,depending upon input date it will pick up the values from the 2nd table and multiply the origional amount

@sahubibhuti45 

ok. 

but if let us say you choose 20 of january, 

then all the data of the table Loan, should be multipled by the conversion amount of 20 of jan , respecting the currencies. 

 

is that right ? 

yes @Daniel29195 , Absolutely correct.

 @sahubibhuti45 

1. create a new column in both table as follow : 

curreny_col_name & "|" & date 

 

nB:  make sure that the date is written in the same format in both tables. 

 

2.now you can link the 2 tables, on this column created . (  it should be a 1 to many relationship going from currency history table (1)  to loan table ( many ) 

 

3. 

from here, things should be easy. 

you can create a new column in the loan table as  : related( curreny_history_table_name[ conversion amount col name] ) 

 

now you have the conversion amount in your loan table. 

 

 

hope this helps .

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Yes @Daniel29195 , Thats correct.

tried with solutions but unable to take 2 different columns from 2 different tables

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.