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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PBIDaxter
Regular Visitor

Calculation Item giving incorrect result when 'variance %' related report measure is used

Hi, I have a query regarding a calculation item and results given when different report level measures are added.

Apologies if this has been raised previously as I couldnt find a proper solution. 

Highly appreciate all answers.

 

I have a calculation group called "Calc Group1" with below 3 calc items; (I have changed some namings for this post)

 

Revenue_1CALCULATE (SELECTEDMEASURE (), Category = 1)

Revenue_2=  CALCULATE (SELECTEDMEASURE (), Category = 2)

 

Revenue_3 = Revenue_1 + Revenue_2

Currently Revenue_3 is written as below;

Revenue_3 = 

CALCULATE(SELECTEDMEASURE(), 'Calc Group1 = "Revenue_1"+
CALCULATE(SELECTEDMEASURE(), 'Calc Group1 = "Revenue_2")
 
Now, I have 3 report level measures defined as below;
 
Actual Amount = CALCULATE(SUM(Transactions_Actual[Value]))
Budget Amount = CALCULATE(SUM(Transactions_Budget[Value]))
Budget Variance [Actual Amount] - [Budget Amount]
Budget Variance Percentage = DIVIDE([Budget Variance],([Budget Amount])
 
My issue is that I get an incorrect value for "Budget Variance Percentage" when I create below matrix in Power BI,
 
PBIDaxter_2-1720685871870.png

 

Incorrect Budget variance % is adding the %s of Revenue_1 (50%) and Revenue_2 (14.29%) rather than considering the actual/budget values of "Net Revenue" metric itself (1050/2350 = 44.68%).

 

Based on research looks like this is ocurring due to the sideways recursion of calculation groups - but I am unclear.

 

Can I know why this is happening and what's the best way to fix it keeping the structure of the calc group and Report measures intact?

 

Thanks!

 
2 REPLIES 2
v-nuoc-msft
Community Support
Community Support

Hi @PBIDaxter 

 

Please provide sample data that fully covers your issue and the expected outcome based on the sample data you provided.

 

Regards,

Nono Chen

Hi,

 

Apologies for the delay.

 

I can't seem to attach any files to this post. But below is the sample data for the table;

 

ActualBudgetCategory
100010001
5002501
15007501
50502
150752
2002252

 

You can create the calculation items via below;

 

Revenue_1 = CALCULATE(SELECTEDMEASURE(),FactRevenue[Category] = 1)
Revenue_2 = CALCULATE(SELECTEDMEASURE(),FactRevenue[Category] = 2)
Revenue_3 =
CALCULATE(SELECTEDMEASURE(),'Calc Group1'[Calculation group column] = "Revenue_1")
+
CALCULATE(SELECTEDMEASURE(),'Calc Group1'[Calculation group column] = "Revenue_2")
 
and measures as below;
 
Actual Amount = CALCULATE(SUM(FactRevenue[Actual]))
Budget Amount = CALCULATE(SUM(FactRevenue[Budget]))
Budget Variance = [Actual Amount] - [Budget Amount]
Budget Variance Percentage = DIVIDE([Budget Variance],[Budget Amount])
 
Issue is that I get an incorrect value for 'Budget Variance Percentage'
 
PBIDaxter_0-1721222006302.png

Based on the values, correct answer is 1050/2350 = 44.6%

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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