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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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