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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MaryGraceP
New Member

Sum for each Different Job Number

I created the "POUNDS OUT" measure (see code below) which I want to equal the sum of the column Perfection for each Job when WIP/ING/PKG is equal to "Line". 

 

The way I have the measure set up, it will display properly when WIP/ING/PKG is included in the table but when I take it out it sums all of the Perfection column. AKA it equals 773k instead of retaining its value of 70K. 

 

Do I need to create the measure differently? Add something? Thanks for the help!

 

MaryGraceP_0-1763042353705.png

 

POUNDS OUT =
CALCULATE(
    SUM('Yield Table'[Perfection]),
    FILTER(
        'Yield Table',
        contains ( 'Yield Table', 'Yield Table'[WIP/ING/PKG],"Line")
    ))
1 ACCEPTED SOLUTION
ajaybabuinturi
Memorable Member
Memorable Member

Hi @MaryGraceP,

 

COuld you please try with below DAX

POUNDS OUT =
VAR CurrentJob = SELECTEDVALUE('Yield Table'[job])
RETURN
CALCULATE(
SUM('Yield Table'[Perfection]),
  FILTER(ALL('Yield Table'),
    'Yield Table'[job] = CurrentJob && 'Yield Table'[WIP/ING/PKG] = "Line"
        )
)

 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

2 REPLIES 2
MasonMA
Community Champion
Community Champion

Thie simpler way is using KEEPFILTERS to wrap over the filter context. 

Measure2 =
CALCULATE(
    SUM('Table'[Perfection]),
    KEEPFILTERS('Table'[WIP/ING/PKG] = "Line")
    )

MasonMA_0-1763046427018.png

 

ajaybabuinturi
Memorable Member
Memorable Member

Hi @MaryGraceP,

 

COuld you please try with below DAX

POUNDS OUT =
VAR CurrentJob = SELECTEDVALUE('Yield Table'[job])
RETURN
CALCULATE(
SUM('Yield Table'[Perfection]),
  FILTER(ALL('Yield Table'),
    'Yield Table'[job] = CurrentJob && 'Yield Table'[WIP/ING/PKG] = "Line"
        )
)

 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors