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

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