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
Anonymous
Not applicable

Show occupancy percentage

I have a measure that shows warehouse occupancy with a simple metric of:

qty_products (numer of rows in my table) / max_capacity (maximum capacity that each product family has). 

 

The occupation of warehouses is done by product family and all products can be divided into different families. So I want to build a chart that shows the percentage of occupancy of each family within the same warehouse.


For example, in the AZT warehouse I have products from the X family and the Y family. The storage capacity of the X family in the AZT warehouse is 6 and the storage capacity of the Y family in the AZT warehouse is 4.
In my table I have 2 products from the X family and 3 products from the Y family. So the percentage of occupation of the AZT warehouse for these families would be:


Family X: 20% (20/10)
Family Y: 30% (30/10)

 

How can I create a chart like this, which accumulates the maximum capacity of each family within the same warehouse and then show me the occupancy percentage that each family has for a given warehouse?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

Table 2 =
SUMMARIZE(
    'Table','Table'[warehouse],'Table'[family],"max",MAX('Table'[storage capacity]))

2. Join the relationship between two tables.

vyangliumsft_0-1680835339472.png

3. Create measure.

Maxstorage =
MAXX(
    FILTER(ALL('Table'),
    'Table'[warehouse]=MAX('Table'[warehouse])&&
    'Table'[family]=MAX('Table'[family])),
    [storage capacity])
All_Group =
var _count=
COUNTX(
    FILTER(ALL('Table'),
    'Table'[warehouse]=MAX('Table'[warehouse])&&'Table'[family]=MAX('Table'[family])),[family])
var _sum=
SUMX(
    'Table 2',[max])
return
DIVIDE(
    _count,_sum)

4. Result:

vyangliumsft_1-1680835339474.png

 

Best Regards,

Liu Yang

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create calculated column.

Table 2 =
SUMMARIZE(
    'Table','Table'[warehouse],'Table'[family],"max",MAX('Table'[storage capacity]))

2. Join the relationship between two tables.

vyangliumsft_0-1680835339472.png

3. Create measure.

Maxstorage =
MAXX(
    FILTER(ALL('Table'),
    'Table'[warehouse]=MAX('Table'[warehouse])&&
    'Table'[family]=MAX('Table'[family])),
    [storage capacity])
All_Group =
var _count=
COUNTX(
    FILTER(ALL('Table'),
    'Table'[warehouse]=MAX('Table'[warehouse])&&'Table'[family]=MAX('Table'[family])),[family])
var _sum=
SUMX(
    'Table 2',[max])
return
DIVIDE(
    _count,_sum)

4. Result:

vyangliumsft_1-1680835339474.png

 

Best Regards,

Liu Yang

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

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.