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
akkitek
Helper III
Helper III

Creating a measure to sum values from two tables with different filters

Hi Everyone,
I need a little help with a calculation I am trying to write. I am trying to create a measure to sum values from two different tables with different filters. Both these cards have the same date filter (showing data only for this month). The first one is milestone amount from the invoice table (filter: Invoice_Milestone[Time Contract Terms] = "Fixed Price"). This is measure I wrote: 

Fixed Price Milestone Amount = CALCULATE(SUM(Invoice_Milestone[Milestone Amount]),Invoice_Milestone[Time Contract Terms] = "Fixed Price")
The other one is Billing Adjusted Revenue from the Fact_ops_data_by_wk table (filter: DIM_ContractLineItem[Time Contract Terms] = "Time and Materials"). This is measure I wrote:
T&M BAR = CALCULATE(SUM(FACT_Ops_Data_by_Wk[Billing Adjusted Revenue]),DIM_ContractLineItem[Time Contract Terms] = "Time and Materials",DIM_Date[Date] = MAX(DIM_Date[Date]))
Now I need to write a measure to add the two values from the latest date in the month. I tried writing the following but it doesn't seem to work. 
Fixed Price + T&M = [Fixed Price Milestone Amount] + [T&M BAR]
So my desired result will be a card visual with the sum of the two values. In this case it should be: 503.4K
Here's the link to my sample file: https://drive.google.com/file/d/1cUCFKSLCdSnE-7pv2gZwfLh1HoQsH3NP/view?usp=sharing
@amitchandak  @Ashish_Mathur  - Any help is appriciated! Thank you!

 

akkitek_0-1677584511504.png

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur ! You're the best!!

 

You are welcome.  Thank you for your kind words.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.