cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Counting Values of separate Categories within a table

Dear all,

I am pretty new to Power BI. I have done a few courses, but more complex DAX expressions are still difficult to me. Hence my cry for help.

I work in container logistics and I am trying to create a dashboard that displays the longevity of my current stock (as in for how long do I still have stock at every location).

I have 2 seperate tables. The first one looks a bit like this:

"Depot Stock"

 Depot Container Type A 20DV A 40DV B 20DV B 40HC B 40DV C 40HC C 40DV C 40HC C 20DV

Column "Depot' represents the different physical locations we have throughout Europe. Column "Container Type" represents the amount of different stock is present per depot, every Container type represents 1 Container (so types are present multiple times per depot). For this one I need to calculate how many total stock there is per "Depot", per ctr type, by counting the ctr types.

The second one looks like this:

"Depot Releases"

 Stock Container Type Qty A 20DV 1 A 20DV 4 A 40DV 1 A 40HC 1 A 40HC 1 B 20DV 3 B 40DV 1 B 20DV 1 B 40HC 2 B 40HC 1 C 20DV 1 C 20DV 2 C 20DV 1

This represents the amount of stock that has already been booked out for the upcoming week, per depot, per container type.

Same exercise as above: Count the amount of total releases per depot per ctr type.

The eventual goal is to Divide the Total current stock with the Total released stock to come; which will tell me how many weeks worth of stock we still have (a release is valid for one week, just saying to make sense out of my thinking).

In reality the list is thousands of lines long as we handle 100+ depots all over Europe, each depot containing hundreds of containers.

1 ACCEPTED SOLUTION
Super User

Hi @TimLoots
Please refer to attached sample file with the solution

2 REPLIES 2
Frequent Visitor

I was clearly overcomplicating things for myself 😉 I tip my hat to you good sir, thanks!

Super User

Hi @TimLoots
Please refer to attached sample file with the solution

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors