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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Help on Relating 2 Facts Tables with SELECTEDVALUE

Hi,

 

I have 2 fact tables: Timesheet (FINALProjectResourceUtilization_NoHistoricalInvoice) & Invoice (InvoiceRow-NoHistoricalInvoice'[LocalRawRevenueAmount]) connecting to multiple dimension tables.

 

What I need is to join both fact tables to derive the hours variance & amount variance. 

Invoice table - Hours Invoiced, Hourly Rate, Amount Invoiced

Timesheet table - Hours Produced

Hours Variance = Hours Invoiced - Hours Produced

Amount Produced = (Hours Variance) * Hourly Rate (different rate for different period of time)

 

wechin_0-1635488917071.png

 

For my Amount Produced measured, why is the sumx not showing at the total row? This is the formula I use:

 

Amount Produced = SUMX(FINALProjectResourceUtilization_NoHistoricalInvoice, FINALProjectResourceUtilization_NoHistoricalInvoice[ResourceHours] * SELECTEDVALUE('InvoiceRow-NoHistoricalInvoice'[LocalRawRevenueAmount]))

 

Your help is greatly appreciated.

3 REPLIES 3
Anonymous
Not applicable

Hi @v-yanjiang-msft, thanks for the help. It has been solved. 🙂

v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, you should also use CALCULATE function to return the total value, like this:

vkalyjmsft_0-1635995555423.png

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide a sample dataset with the involved tables of your datamodel.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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