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
TimLoots
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"

DepotContainer Type
A20DV
A40DV
B20DV
B40HC
B40DV
C40HC
C40DV
C40HC
C20DV

 

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"

StockContainer TypeQty
A20DV1
A20DV4
A40DV1
A40HC1
A40HC1
B20DV3
B40DV1
B20DV1
B40HC2
B40HC1
C20DV1
C20DV2
C20DV1

 

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. 

 

Thanks for your advice

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

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

1.png3.png

View solution in original post

2 REPLIES 2
TimLoots
Frequent Visitor

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

tamerj1
Super User
Super User

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

1.png3.png

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.

Top Solution Authors