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
leejoel
Helper I
Helper I

Compare fixed value vs sum of values

Hello,

I am building a report where I need to compare the monthly sum (actual #) against a fixed goal (target #). I tried it out on my own but I'm not quite there.

 

TEST = IF(TOTALMTD(SUM('Sheet1'[ACTUAL HRS]))>'Sheet1'[TARGET HRS],1,0)
 
This results in an ERROR. Hoping someone can help?
8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.  Do you need a calculated column or a measure solution?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur @amitchandak  Thanks for the replies. I am attaching a small sample of the data and hoping you can use it to help me. Every day there are downtime occurrences that add up (in minutes) and we need to compare the SUM by location against a fixed monthly target. See below and let me know if you need any more info from me.

 

Location 1 Monthly Target: 9.425 hours

Location 2 Monthly Target: 9.025 hours

Location 3 Monthly Target: 15.60 hours

 

LocationStart_TimeEnd_TimeMinutes of Downtime

11/9/2020 9:48:14 PM1/9/2020 9:50:47 PM2
11/9/2020 8:49:08 PM1/9/2020 9:06:49 PM17
31/9/2020 4:44:57 PM1/9/2020 5:06:29 PM22
21/9/2020 2:33:13 PM1/9/2020 3:33:44 PM60
21/8/2020 2:33:30 PM1/8/2020 2:33:58 PM0
21/8/2020 10:23:06 AM1/8/2020 2:13:54 PM230
21/8/2020 9:32:42 AM1/8/2020 9:36:34 AM4
21/7/2020 3:13:12 PM1/7/2020 3:50:16 PM37
31/7/2020 2:38:18 PM1/7/2020 3:43:08 PM65
31/7/2020 12:46:42 PM1/7/2020 1:16:07 PM30
31/7/2020 4:14:40 AM1/7/2020 4:21:09 AM7
21/6/2020 8:38:14 PM1/6/2020 8:41:07 PM3
21/6/2020 7:55:26 PM1/6/2020 7:58:19 PM3
21/6/2020 5:19:10 PM1/6/2020 5:27:23 PM8
31/6/2020 1:39:55 PM1/6/2020 3:16:11 PM97
21/6/2020 12:57:08 PM1/6/2020 1:00:23 PM3
31/6/2020 9:56:46 AM1/6/2020 10:37:30 AM41
31/5/2020 6:06:42 PM1/5/2020 6:09:29 PM3
21/4/2020 10:16:24 PM1/4/2020 10:23:21 PM7
21/4/2020 8:30:09 PM1/4/2020 8:35:33 PM5
31/3/2020 11:28:34 AM1/3/2020 12:06:14 PM38
11/3/2020 9:19:03 AM1/3/2020 9:23:14 AM4
11/3/2020 9:12:24 AM1/3/2020 9:16:54 AM4
11/3/2020 9:06:54 AM1/3/2020 9:10:12 AM4
21/3/2020 6:02:02 AM1/3/2020 6:06:43 AM4
31/3/2020 1:10:35 AM1/3/2020 4:22:49 AM192
11/2/2020 2:27:38 PM1/3/2020 2:27:25 AM720
11/2/2020 2:19:31 PM1/2/2020 2:21:58 PM2
11/2/2020 2:11:28 PM1/2/2020 2:18:59 PM7
11/2/2020 1:38:54 PM1/2/2020 2:08:39 PM30
11/2/2020 3:17:09 AM1/2/2020 3:57:12 AM40
21/2/2020 1:20:59 AM1/2/2020 1:23:22 AM3
21/2/2020 12:06:47 AM1/2/2020 12:12:51 AM6
11/1/2020 8:25:46 PM1/1/2020 9:13:39 PM48
21/1/2020 7:51:33 PM1/1/2020 7:53:58 PM2
21/1/2020 6:31:38 PM1/1/2020 7:05:15 PM34
11/1/2020 6:17:04 PM1/1/2020 6:22:03 PM5

Hi,

You may download my PBI file from here.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_MathurThank you. I unzipped the file and the file reads corrupt or invalid.

Hi, @leejoel 

Could you please tell me whether your problem has been solved?
If it is,  please mark the helpful replies or add your reply as Answered to close this thread.

 

Best Regards,
Community Support Team _ Eason

It is .pbix file.  Why are you unzipping it?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

Total MTD need a date column

try like

TEST = IF(TOTALMTD(SUM('Sheet1'[ACTUAL HRS]),'Date'[Date])> sum('Sheet1'[TARGET HRS]),1,0)

Assume a date table here

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

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

I tried this and everything comes back as a '0' value.

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.