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

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

Reply
android1
Post Patron
Post Patron

SUM values if date equal to

Hi,

 

Trying to SUM the values in column Num Hrs if iDate = 17 Marach 2017.

 

Have this so far -> Bank Hol = CALCULATE(SUM(CarerActualWork[Num Hrs]),CarerActualWork[iDate]= "17 March 2017")

 

but not quite right.

 

Gerry

8 REPLIES 8
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @android1

 

Please try this slight variation

 

Bank Hol = CALCULATE(
			SUM(CarerActualWork[Num Hrs]),
			CarerActualWork[iDate]= DATE(2017,3,17)
			)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil,

 

Hi Phil, Thanks for that. For some reason it's summing for all dates.2017-03-27 21_13_00-Service Summary Newcare Act Hrs - Power BI Desktop.png

Hi @android1

 

Any chance you can mock up your expected result for that dataset?

 

Cheers,

 

Phil


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Mock Up Results.jpg

Anonymous
Not applicable

Hi @android1,

 

According to your description, you want to calculate the running total, right?
If this is a case, you can try to use below formula.

 

Bank Hol = CALCULATE(
			SUM(CarerActualWork[Num Hrs]),
			CarerActualWork[iDate] <= MAX(CarerActualWork[Date])
			)

 

 

Regards,

Xiaoxin Sheng

Thanks for the reply,

 

What I want is to show Num Hrs as a new column called Bank Hol & only display Num Hrs for the date 17th March 2017 which is a Bank Holiday. This column should only contain Num Hrs if Num Hrs are there for this date only.

 

Gerry

Hi,

 

What in this measure could possibly mean that Bank Hol are shown for dates other than 17th March 2017? 

Makes no sense to me.

 

Bank Hol = CALCULATE(SUM(CarerActualWork[Num Hrs]),CarerActualWork[iDate] = DATE(2017,03,17))

 

Bank Hol Hrs.jpg

Anonymous
Not applicable

Hi @android1,

 

If you want to get the sum of the data when date is equall to 03/17/2017, You can use all function to ignore the original filter:

 

Bank Hol = CALCULATE(SUM(CarerActualWork[Num Hrs]),FILTER(ALL(CarerActualWork),CarerActualWork[iDate] = DATE(2017,03,17)))

Sum of values which has the same date:

 

 

Bank Hol = 
SUMX(FILTER(ALL(CarerActualWork),CarerActualWork[iDate] = MAX(CarerActualWork[iDate])),CarerActualWork[Num Hrs])

 

 

Regards,

Xiaoxin Sheng

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.