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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors