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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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