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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alex9999
Helper I
Helper I

Inventory Tracker DAX

Hi, 

 

I am currently creating an inventory tracker which tracks items moving in or out of a unit. I have created the core functionality of the report. However, I have 300+ items that I need to make individual measures for. The measure so far looks like this:

 

Assuming the item has a base count of 1000:

 

Item = 1000 + CALCULATE(SUM('Inventory'[Quantity]), FILTER('Inventory', 'Inventory'[Material_In_True] = TRUE() && 'Inventory[Component] = "Item")) - CALCULATE(SUM('Inventory'[Quantity]), FILTER('Inventory', 'Inventory'[Material_In_True] = FALSE() && 'Inventory[Component] = "Item"))

 Essentially, I take the base value and plus and minus any entries of that component that is fed through a SharePoint list.

 

I am currently pulling my hair out creating a measure for every individual component. Furthermore, I will be calculating the weight of each component so I will be creating a measure for each individual items weight * quantity to get the total weight. I will be left with 600+ measures in this report.

 

Any help with a time saving solution will be appreciated.

8 REPLIES 8
Anonymous
Not applicable

Hi @alex9999 

Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Community Support Team _ Ailsa Tao

BeaBF
Super User
Super User

@alex9999 Hi!

What do you think about calculating a dynamic measure through the ALLSELECTED function and using a filter on the Item in order to calculate the measure related to that ?

 

BF

Hi @BeaBF , 

 

The solution suggested will not work as I will eventually need to display items in a table so I can view all metrics of each component.

 

Can you suggest something else?

 

Kind regards

@alex9999 can you paste some data and an example of the expected result for two items? so as to better understand the request and do some tests

 

BF

@BeaBF , my report will have data shown as such:

 

Date & TimeSupervisorIn/OutComponentQuantity
28/02/2022 11:22J. BloggsOutItem A30
28/02/2022 12:30J. BloggsOutItem B45
28/02/2022 1:35C. JonesInItem A22
28/02/2022 2:20J. BloggsInItem B20

 

This table is being fed through a SharePoint list that is being updated by a foreman who is tracking everything that moves in and out of the unit. Once we do an initial count of the unit and the items in it (which is represented by the first figure of the DAX measure), everything that goes into the unit will be added onto that number, while everything that moves out will be minused from that same figure - leaving us with an accurate figure of each component.

 

My issue was that I am having to create a measure for every single item individually and I think my computer is going to explode soon.

 

I'm not sure if there is an easier way to go about creating my report rather than having 600 measures for total quantity and total weight.

 

Thanks for any help, @BeaBF .

@alex9999 do you necessarily need a measure? instead create a column calculated with the if conditions? 

I'm trying to reason with you ...

 

BF

Hi @BeaBF

 

Can you elaborate please?

 

I am new to Power BI so please don't take it as I am stubborn, I am just inexperienced.

@alex9999 Sure!

The main difference between calculated columns and measures is that columns are evaluated at each row, whereas measures are only evaluated at the level of granularity they are plotted at.

 

Calculating it through a calculated column, it then calculates row x row your expression, inserting some if conditions.
To help you concretely, on the example data you have reported above, can you try to write me two measures? I will try to simplify them into one.

 

BF

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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