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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable
1 REPLY 1
Anonymous
Not applicable

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.