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
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
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.

Top Solution Authors