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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
enlodi
Frequent Visitor

Issue with Subtotals/formula in a matrix

Hi guys,

 

I'm quite desperate with a thing that it didn't seem to be that tricky. 

 

I've made up a matrix with a FC estimation. The problem is that the subtotals are not correctly calculated. I believe that the confilct is linked with the formula that I've used :

 

Sales Forecast formula =
VAR
SalesLY= CALCULATE([total sales], DATEADD(DATES[Date],-1,YEAR))
VAR
Sales2YearsAgo= CALCULATE([total sales],DATEADD(DATES[Date],-2,YEAR))
VAR
Sales2020= SUM('Order intake'[true value])
VAR
factor = 0.95
RETURN
IF(ISBLANK(Sales2020),DIVIDE(SalesLY + Sales2YearsAgo,2 ,0) * factor ,
DIVIDE(Sales2020 + SalesLY, 2, 0) * factor)
 
With the previous formula, I'm getting the correct amounts per month, but the subtotals per quarter and year are not corrects. Indeed, the problem is that the formula above is been applied to the subtotals and year rows (and i don't want that).
 

Do you now how could I fix it up? I've been trying for two days with anyluck at all.

 

Kind regards, 

Enrique.

 
 
 
8 REPLIES 8
az38
Community Champion
Community Champion

@enlodi 

how do you calculate [total sales] ?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
enlodi
Frequent Visitor

using the following formula:

 

Total Sales = SUM('Order intake'[true value])
 
 
** True value = total sales 
az38
Community Champion
Community Champion

@enlodi 

whats formula do you use?

for correct total it should be smth like

=CALCULATE(SUM([Column]))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
enlodi
Frequent Visitor

Hi mate,

I've just updated my post with the formula 🙂

amitchandak
Super User
Super User

Please share the formula. Can you share sample data and sample output. Thanks.
Proud to be a Datanaut My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

How could I share that info with you? I'm not finding the option "attach" or something like that. (I'm pretty new in PBI as you could see) 

Try like this in sumx or averagex

averagex(summarize('Order intake',Date[Month year],"_Avg",IF(ISBLANK(Sales2020),DIVIDE(SalesLY + Sales2YearsAgo,2 ,0) * factor ,
DIVIDE(Sales2020 + SalesLY, 2, 0) * factor)),[_Avg])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for your response 🙂

 

I've just shared the formula that is working, but is not the case with the subtotals.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.