cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
evdhoning
Regular Visitor

Calculate the sum of the individual grouped values

Hi,

 

I created a measure that calculates a certain number. This is the measure:

--------------------

VAR =
VAR ActualsTotal = CALCULATE([Sum of Sales], ALLSELECTED(TABLE))
VAR ActualsPercTotal = DIVIDE([Sum of Sales], ActualsTotal)

VAR BudgetTotal = CALCULATE([Sum of Budget], ALLSELECTED(TABLE))
VAR BudgetPercTotal = DIVIDE([Sum of Budget], BudgetTotal)

VAR Margin = [Margin % Budget]

VAR MarginTotal = CALCULATE([Margin % Budget], ALLSELECTED(TABLE))

RETURN
(ActualsPercTotal - BudgetPercTotal) * (Margin - MarginTotal)

--------------------

 
When I create a crosstab or table with a column "Category" and the measure, this is the result:
 
CATEGORY VAR
Car 0.1
Bike 1.4
Bus -0.5
----------------
Total 0.0
 
These numbers are correct. But I would like the total to be the sum of the 3 rows. In this example the total is 0, which is result of the measure when no category is used. The result I would like to have is 1.0 (the sum of 0.1, 1.4 and -0.5)
 
Does anyone know how to create a formula that does the same but adds up the individual grouped values?
1 ACCEPTED SOLUTION
daxer
Solution Sage
Solution Sage
1 REPLY 1
daxer
Solution Sage
Solution Sage

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors