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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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