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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
khisla
Helper II
Helper II

Calculate Total - Wrong Total Sum

Hello All-

 

I need to calculate the total hours worked by employees on a particular date AND specific store.

See data below and expected total hours column calculated.

 

DateStoreEmployee #Hours WorkedTotal Hours
01/04/2025IL2072084683557.7242.25
01/04/2025IL2072114531967.942.25
01/04/2025IL2072141446697.5742.25
01/04/2025IL2072163508764.9342.25
01/04/2025IL2072163508847.6842.25
01/04/2025IL2073317250856.4542.25
01/04/2025IL2132088415027.613.32
01/04/2025IL2133278772395.7213.32
02/04/2025IL2142065384156.2267.93
02/04/2025IL2142094572908.267.93
02/04/2025IL214212804512867.93
02/04/2025IL2142130311316.367.93
02/04/2025IL2142137640796.267.93
02/04/2025IL2143143781348.2767.93
02/04/2025IL2143190617506.0767.93
02/04/2025IL2143278258246.2567.93
02/04/2025IL2143284065746.467.93
02/04/2025IL2143457072106.0267.93

 

I tried the below however an getting the wrong total sum

Total Hours =
CALCULATE(
    SUM(Table[Hours Worked]),
    ALLEXCEPT(Table, Table[Date], HILAN[Store])
)
 
Can someone help with a DAX formula.
Thanks!
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated column.

 

Jihwan_Kim_0-1754672638057.png

 

 

CC Total Hours = 
VAR _date = Data[Date]
VAR _store = Data[Store]
VAR _t =
    FILTER ( Data, Data[Date] = _date && Data[Store] = _store )
RETURN
    SUMX ( _t, Data[Hours Worked] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated column.

 

Jihwan_Kim_0-1754672638057.png

 

 

CC Total Hours = 
VAR _date = Data[Date]
VAR _store = Data[Store]
VAR _t =
    FILTER ( Data, Data[Date] = _date && Data[Store] = _store )
RETURN
    SUMX ( _t, Data[Hours Worked] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Got the same result as my DAX which is incorrect.  The expected total hours vary

 

DateStoreEmployee #Hour WorkedTotal Hours
01/04/2025IL2072084683557.7281.99
01/04/2025IL2072114531967.981.99
01/04/2025IL2072141446697.5781.99
01/04/2025IL2072163508764.9381.99
01/04/2025IL2072163508847.6881.99
01/04/2025IL2073317250856.4581.99
01/04/2025IL2132088415027.613.32
01/04/2025IL2133278772395.7213.32
02/04/2025IL2142065384156.2276.01
02/04/2025IL2142094572908.276.01
02/04/2025IL214212804512876.01
02/04/2025IL2142130311316.376.01
02/04/2025IL2142137640796.276.01
02/04/2025IL2143143781348.2776.01
02/04/2025IL2143190617506.0776.01
02/04/2025IL2143278258246.2576.01
02/04/2025IL2143284065746.476.01
02/04/2025IL2143457072106.0276.01
FBergamaschi
Solution Sage
Solution Sage

Please show the incorrect total calculation result

DateStoreEmployee #Hour WorkedTotal Hours
01/04/2025IL2072084683557.7281.99
01/04/2025IL2072114531967.981.99
01/04/2025IL2072141446697.5781.99
01/04/2025IL2072163508764.9381.99
01/04/2025IL2072163508847.6881.99
01/04/2025IL2073317250856.4581.99
01/04/2025IL2132088415027.613.32
01/04/2025IL2133278772395.7213.32
02/04/2025IL2142065384156.2276.01
02/04/2025IL2142094572908.276.01
02/04/2025IL214212804512876.01
02/04/2025IL2142130311316.376.01
02/04/2025IL2142137640796.276.01
02/04/2025IL2143143781348.2776.01
02/04/2025IL2143190617506.0776.01
02/04/2025IL2143278258246.2576.01
02/04/2025IL2143284065746.476.01
02/04/2025IL2143457072106.0276.01

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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