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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.