The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a dataset that holds exports of inventory counts grouped by month. An example would be if I had 10 apples with barcode 44444 at the end of January and a didn't sell any, then I would have 10 apples with that same barcode 44444 at the end of February. This would show up one right after another when sorting by apples and then by month.
The question I have: If when March's report came out it and I had 7 new apples with a new barcode 55555 along with the orignial 10 apples totaling 17 apples. Since I already knew I had 10 apples with the 44444 I dont want to see them, I would only want to see the new apples.
Mainly what I am asking for is a way to see only "new" inventory that has shown up for that month. My idea is to sort by unique barcodes as filter for that specific month.
In Power BI, you can achieve the goal of viewing only "new" inventory that has shown up for a specific month by using a combination of calculated columns and filters. Here are the steps to do this:
Create a Calculated Column for Monthly Totals: Start by creating a calculated column that calculates the total inventory count for each product (barcode) for each month. You can use the SUMX and FILTER functions to achieve this. Let's assume your table is called "Inventory" and it has columns like "Barcode," "Month," and "Count." Here's an example of how to create the calculated column:
MonthlyTotalCount = SUMX( FILTER( Inventory, Inventory[Month] = EARLIER(Inventory[Month]) && Inventory[Barcode] = EARLIER(Inventory[Barcode]) ), Inventory[Count] )
This calculated column will give you the total count of each product for each month.
Create a Filter for New Inventory: Now, you can create a filter in your visualizations to show only the rows where the "MonthlyTotalCount" is equal to the "Count" for that specific month. This will filter out the rows for products that already existed in previous months. In your visual, you can use a slicer or a filter visual to allow users to select a specific month.
For example, you can use a table or matrix visual, and then set the filter condition as follows:
This will show only the "new" inventory items for the selected month.
Now, when you select a specific month in your slicer or filter visual, it will display only the products that are considered "new" for that month based on your criteria. The calculated column "MonthlyTotalCount" ensures that you're comparing the count for each product only within the same month, filtering out products that were already present in previous months.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
76 | |
65 | |
52 | |
51 |
User | Count |
---|---|
127 | |
116 | |
78 | |
64 | |
63 |