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

SUM value based on multiple columns

Hi all, I am trying to add a column that is representing the sum of only one of the repeating values within a certain number of rows that are part of a defined hoger level of rows.

 

Basically for all the same 'CASEID'I only want to use Hours once and create a column tht represents the total hours on 'Main_WO' level. The output I am looking for is shown in Table Column "MainWo_Total_HRS"

Row dat typically represents all kind of different Item ID's 

 

Main_WOEPCAMCASEIDAppl_Lab_Hours_ProjIDMainWO_Total_HRSRowdata
W0003447W0003447117.01156.441
W0003447W0003447117.01156.442
W0003447W00034470139.43156.4417
W0003447W00034470139.43156.4418
W0003447W00034470139.43156.4419
W0003447W00034470139.43156.44150
W0003447W000344701010156.44151
W0003447W000344701010156.44152
W0003447W000344701020156.44157
W0003447W000344701020156.44158
W0003447W000344701030156.44164
W0003447W000344701030156.44165
W0003447W000344701030156.44170
W0003447W000344701040156.44171
W0003447W000344701040156.44172
W0003447W000344701040156.44173
W0003447W000344701050156.44174
W0003447W000344701060156.44175
W0003447W000344701080156.44176
W0003447W000344701090156.44177
W0003447W000344701090156.44178
W0004034W0004034148.1218.89182
W0004034W0004034148.1218.89183
W0004034W0004034148.1218.89184
W0004034W0004034148.1218.89283
W0004034W00040340137.06218.89284
W0004034W00040340137.06218.89285
W0004034W00040340137.06218.89286
W0004034W00040340137.06218.89367
W0004034W00040340137.06218.89368
W0004034W00040340137.06218.89369
W0004034W000403401010218.89370
W0004034W000403401010218.89371
W0004034W000403401010218.89372
W0004034W000403401020218.89379
W0004034W000403401030218.89380
W0004034W000403401050218.89381
W0004034W000403401060218.89382
W0004034W000403401060218.89383
W0004034W000403401080218.89384
W0004034W000403401080218.89385
W0004034W000403401080218.89386
W0004034W000403401080218.89387
W0004034W000403401090218.89388
W0004034W000403401090218.89389
W0004034W000403401100218.89396
W0004034W000403401120218.89397
W0004034W000403401120218.89398
W0004034W000403401120218.89412
W0004034W000403401130218.89413
W0004034W00040340233.73218.89414
W0004034W00040340233.73218.89415
W0004034W00040340233.73218.89503
W0004034W00040340233.73218.89504
W0004034W00040340233.73218.89505
W0004034W000403402010218.89506
W0004034W000403402010218.89509
W0004034W000403402020218.89510
W0004034W000403402030218.89511
W0004034W000403402040218.89512
W0004034W0004034030218.89513
W0004034W0004034040218.89514
W0004034W0004034040218.89515
W0004034W0004034040218.89520
W0004034W0004034050218.89521
W0004034W0004034050218.89522
W0004034W0004034050218.89523
W0004034W0004034050218.89524
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@BeeleJa,

Try this calculated column:

MainWo_Total_HRS = 
VAR vMainWO = WorkOrders[Main_WO]
VAR vMainWOTable =
    FILTER ( WorkOrders, WorkOrders[Main_WO] = vMainWO )
VAR vDistinctCaseID =
    SUMMARIZE (
        vMainWOTable,
        WorkOrders[EPCAMCASEID],
        WorkOrders[Appl_Lab_Hours_ProjID]
    )
VAR vResult =
    SUMX ( vDistinctCaseID, WorkOrders[Appl_Lab_Hours_ProjID] )
RETURN
    vResult

DataInsights_0-1604612512260.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@BeeleJa,

Try this calculated column:

MainWo_Total_HRS = 
VAR vMainWO = WorkOrders[Main_WO]
VAR vMainWOTable =
    FILTER ( WorkOrders, WorkOrders[Main_WO] = vMainWO )
VAR vDistinctCaseID =
    SUMMARIZE (
        vMainWOTable,
        WorkOrders[EPCAMCASEID],
        WorkOrders[Appl_Lab_Hours_ProjID]
    )
VAR vResult =
    SUMX ( vDistinctCaseID, WorkOrders[Appl_Lab_Hours_ProjID] )
RETURN
    vResult

DataInsights_0-1604612512260.png





Did I answer your question? Mark my post as a solution!

Proud to be a 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.