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
smpa01
Super User
Super User

Maximum size subset with given sum

Hello experts,

 

I have a data set, e.g. as following

 

Raw Data={1,2,3,4,5,6,-0.75,-0.25,-1,-1,-3,-3.5,-0.5,-12}

 

I want to create a subset of this data which would include max number of members where the sum of all those memebrs would equate to 0.

Desired = {1,2,3,4,-0.75,-0.25,-1,-1,-3,-3.5,-0.5}

SUM=0

 

Any help is greatly appreciated.

Thanking you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 REPLY 1
smpa01
Super User
Super User

Hello experts,

 

Is there any way to achieve this by using DAX? This can be easlily done using R script.

 

But I can't utilize R script to generate a measure to be displayed on a PBI native viz.

 

Any help is greatly appreciated.

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
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!

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.

Top Solution Authors