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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Forecast vs Actual Variance in Matrix

First of all, my sincere apologies if I am creating this post in a wrong section as this is my first time creating one in this community page. 

 

I was wondering if I can get some help calculating Variance for Forecast vs Actual report. As the name suggests, it is comparing company's Actual sales to what was forecasted. The fact table looks like this - 

 

Rabin_0-1655159258212.png

 

There is a column name RecordType that separates Actual and Forecast quantities. I was able to create weekly forecast vs actual page using matrix, but I am having hard time adding Variance in the matrix. Here is what the matrix looks like - 

Rabin_1-1655159427000.png

 

I am sorry if similar questions have been asked before, and I did see a few that has to do with calculating variance but I could not replicate the solutions.

 

Thank you

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@Anonymous 

You can use the row totals to disply the variance value. Replace the current SUM measure in the matrix with this measure

IF ( HASONEVALUE ( ForecastVsActual[RECORDTYPE] ), 

[current sum measure], [vriance measure] )

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

@Anonymous 

You can use the row totals to disply the variance value. Replace the current SUM measure in the matrix with this measure

IF ( HASONEVALUE ( ForecastVsActual[RECORDTYPE] ), 

[current sum measure], [vriance measure] )

tamerj1
Super User
Super User

Hi @Anonymous 
Usually it is just [Actual] - [Forcast_Inactive]

Am I missing something?

Anonymous
Not applicable

Hi @tamerj1 ,

 

I was able to create the following measures - 

  • SumActual = CALCULATE(ForecastVsActual[Qty],ForecastVsActual[RECORDTYPE] = "Actual")
  • SumForecast = CALCULATE(ForecastVsActual[Qty],ForecastVsActual[RECORDTYPE] = "Forecast")
  • Variance = SUMX(ForecastVsActual,ForecastVsActual[SumActual] - ForecastVsActual[SumForecast])

It works fine when the data is viewed in tabular format as a table - 

Rabin_0-1655231196946.png

 

However, I would like to display the variance in a Matrix right under the Forecast row -

Rabin_1-1655231277996.png

Here is how the matrix is setup currently - 

  • Rows = Type (ForecastVsACtual)
  • Columns = WeekNum
  • Values = Qty

 

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.