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
tobiasmcbride
Helper III
Helper III

Calculating variance

Hi,

 

I have some revenue data and am struggling to calculate the variance of this. The data is formatted as below:

 

ForecastTypeQ1Q2Q3Q4
FY19 BudgetTotal$$$$$$$$$
FY19 Estimate 1Total$$$$$$$$
FY19 Estimate 2Total$$$$$$$$$$$
FY19 Estimate 3Total$$$$$$$$

 

I want to be able to calculate the variance between any of the values in that table across the quarters against the FY19 Budget (i.e. be able to visualise and then conditionally format the variance between FY19 Estimate 1 and Budget, Estimate 2 and Budget and Estimate 3 and Budget (But also have ability to change it to be FY19 Estimate 3 against Estimate 1).

 

What is the best way to do this? Any help much appreciated.

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @tobiasmcbride ,

 

First, add a [index] column in Edit Queries;

Second, create a measures for Q1, Q2, Q3:

Measure for Q1, Other similar:

variance _Q1 = 
VAR x =
CALCULATE(
    MAX(Sheet2[Q1]),
    FILTER(
        Sheet2,
        Sheet2[Index] = MIN(Sheet2[Index])
    )
)
VAR y = 
CALCULATE(
    MAX(Sheet2[Q1]),
    FILTER(
        Sheet2,
        Sheet2[Index] = MAX(Sheet2[Index])
    )
)
RETURN
DIVIDE(
    x-y,
    y
)

y14.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @tobiasmcbride ,

 

First, add a [index] column in Edit Queries;

Second, create a measures for Q1, Q2, Q3:

Measure for Q1, Other similar:

variance _Q1 = 
VAR x =
CALCULATE(
    MAX(Sheet2[Q1]),
    FILTER(
        Sheet2,
        Sheet2[Index] = MIN(Sheet2[Index])
    )
)
VAR y = 
CALCULATE(
    MAX(Sheet2[Q1]),
    FILTER(
        Sheet2,
        Sheet2[Index] = MAX(Sheet2[Index])
    )
)
RETURN
DIVIDE(
    x-y,
    y
)

y14.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

With the help of slicer/s you have control the calculation. Please find example

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

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.