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
GoingIncognito
Advocate III
Advocate III

Creating a measure that scales the sum to 100%

I've table "Basket constitution" that has the weights of differend indices. Weight is an integer. Now, how do I create a measure that scales to 100% for any subset of these weights? E.g. a basket with weights 3+3+5 and 6+10+15 would both scale to 100%? I'm guessing I'd use the function allselected? image.png

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @GoingIncognito ,

 

I'm not sure if i understand you correctly, are you meaning 3,3,5 belong to same category and 6,10,15 belong to another same category and you want to calculate the percentage about each value for each category, like 3/(3+3+5)?

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
GoingIncognito
Advocate III
Advocate III

Maybe I figured this finally out?
Is this correct:

_weight =
var _sum= SUM('Basket constitution'[WEIGHT])
var _whole= CALCULATE( SUM('Basket constitution'[WEIGHT]), ALLSELECTED(table2*) )
return
DIVIDE( _sum, _whole)
*=table2 is the table that provides the row values for the graph I'm trying to build
 
And now if I need to use table3 instead of table2 in my graph, how do I incorporate treatas() ?

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.