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
Syrah5354
New Member

Help with measure required - incorrect column subtotals

Hi All, 

 

I am still quite new to Power BI and DAX and need some help with a measure. I have 3 tables I am using data from as well as a date table they are all connected to. 

 

Tables 

1. Forecast table - weekly values are added for a monthly forecast. 

Date of ForecastForecast MonthSales PersonForecast
5/7/202331/7/2023

John Smith

10000
12/7/202331/7/2023John Smith10500
5/7/202331/8/2023John Smith25000
12/7/202331/8/2023Johh Smith20000

 

2. Quotas - contains information on a sales persons quota by month

Sales PersonMonthQuota
John Smith31/7/202320000
John Smith31/8/202320000

 

3. Actuals - obtained at the end of each month for each sale made

Date of SaleSales Person Amount
4/7/2023John Smith5000
13/7/2023John Smith1000
13/7/2023John Smith1500

 

 

By month, I would like to record the gap to the individuals quota where we use the persons actuals if available, and if not, we use the forecast.

 

This is an example of my current view. It is all accurate except the column subtotals for delta to quota.

Syrah5354_0-1692855384211.png

 

The measures in this view are:

 

Forecast = 

var LatestDateForecast = MAX('Forecast'[Date of Forecast])
return
CALCULATE(SUM('Forecast'[Forecast]),'Forecast'[Date of Forecast] = LatestDateForecast)
 
Actuals = (CALCULATE(SUM('Individual GP Analysis'[Gross Profit])))
 

Quota = SUM(Quotas[Quota])

 

Delta to quota = 

 IF(ISBLANK([Actuals]), [Quota] - [Forecast], [Quota] - [Actuals])
 
This measure is the one I am having issues with. It appears to work for each month but the subtotal is incorrect.
 
Can someone please let me know what I am doing wrong.
 
Thanks so much!
1 REPLY 1
johnt75
Super User
Super User

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.