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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
BeeEyeNoob
Advocate II
Advocate II

Measure to multiply numbers from two unrelated tables.

Table 1 - Using API to get current Bitcoin Price

Table 2 - Using API to get current Bitcoin Holdings

 

I wish to multiply the current Bitcoin Price from Table 1 with my current Bitcoin holdings from Table 2

 

Tables are unrelated.

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@BeeEyeNoob

 

Is there only one value in both tables? 

 

If yes, you just need to use the measure to get those numbers and multiply together.

 

=max(Table1[Bitcoin Price])*max(Table2[Bitcoin Holdings])

 

If not, you supposes to have common columns in both tables so that you cam map corresponding Bitcoin Price and Bitcoin Holdings. Then you should be able to build relationship between those two tables or use LOOPUPVALUES() to get Bitcoin Price associated with each Bitcoin Holding and do any calcuation you want. 

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Employee
Employee

@BeeEyeNoob

 

Is there only one value in both tables? 

 

If yes, you just need to use the measure to get those numbers and multiply together.

 

=max(Table1[Bitcoin Price])*max(Table2[Bitcoin Holdings])

 

If not, you supposes to have common columns in both tables so that you cam map corresponding Bitcoin Price and Bitcoin Holdings. Then you should be able to build relationship between those two tables or use LOOPUPVALUES() to get Bitcoin Price associated with each Bitcoin Holding and do any calcuation you want. 

 

Regards,

Thank you so much, Simon!

samdthompson
Memorable Member
Memorable Member

Am assuming that there are no existing measures and that there is a date on each. Really you need to have a date table with a relationship to the two tables. Am also assuming that both tables are as upto date as each other:

 

Value = CALCULATE(sum(Table1[Holdings]),Lastdate(Table1[Date])) * CALCULATE(average(Table2[Rate]),Lastdate(Table2[Date]))

 

If you had a date table which was up to the current API date you could just refer to the one date table which would be much safer and make for a more robust and usable model. It would be a better solution to also make measures on each of the tables for holding, rates, timeintelligence movements etc.

 

Make sure that the date columns in the API tables are formatted as dates.

 

Cheers.

 

 

 

 

 

// If this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.