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
EAFN
New Member

How to calculate a percentage if it is related to another value

Hi everyone, I'm new to power BI and need some help with a problem. We receive different items quantities that come in different containers and I need to create a column/measure that tells me how much of the container is occupied by each item. This is an example of the data, we have the "ITEM", "QUANTITY" and "CONTAINER" columns, the "RESULT" column is the one that I need to create, thank you for your help.

ITEMQUANTITYCONTAINERRESULT
A9AAA0,600
B4AAA0,267
C2AAA0,133
D6AAB1
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@EAFN 

pls try this

Column = DIVIDE('Table'[QUANTITY],CALCULATE(sum('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[CONTAINER])))

1.PNG

if you want to create a measure ,pls try this

Measure = DIVIDE(sum('Table'[QUANTITY]),CALCULATE(sum('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[CONTAINER])))

2.PNG





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@EAFN 

pls try this

Column = DIVIDE('Table'[QUANTITY],CALCULATE(sum('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[CONTAINER])))

1.PNG

if you want to create a measure ,pls try this

Measure = DIVIDE(sum('Table'[QUANTITY]),CALCULATE(sum('Table'[QUANTITY]),ALLEXCEPT('Table','Table'[CONTAINER])))

2.PNG





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

Proud to be a Super User!




Thank you, the measure worked for me.

you are welcome





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

Proud to be a Super User!




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.