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

Wrong Sum totals when using a SUM measure from two different Tables

I have a table of Expense totals by month and another table of individual Sales.

 

I have managed to link them using a key column of ProductYearMonth which is unique to the Expense table.

 

I can create a matrix with the Columns being Year Month and the rows being product and display Total Revenue and Expense by Product and Period, but I can't work how to calculate Surplus (Revenue-Expense) and ROI (Revenue divided by Expense).  I have tried creating a measure but nothing I try is acceptable as a DAX formula.

 

Thank you for any help you can give me.

1 ACCEPTED SOLUTION
ozpeacenik
Frequent Visitor

I have solved this problem.  I created a column for Revenue and then all my calcs worked.

 

Revenue =
CALCULATE (
SUM ( 'Gift Data'[Gift Amount] ),
FILTER (
ALL ( 'Gift Data'[Gift Date] ),
'Gift Data'[Gift Date] <= MAX ( 'Gift Data'[Gift Date] )
)
)

View solution in original post

1 REPLY 1
ozpeacenik
Frequent Visitor

I have solved this problem.  I created a column for Revenue and then all my calcs worked.

 

Revenue =
CALCULATE (
SUM ( 'Gift Data'[Gift Amount] ),
FILTER (
ALL ( 'Gift Data'[Gift Date] ),
'Gift Data'[Gift Date] <= MAX ( 'Gift Data'[Gift Date] )
)
)

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.