Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I've got a dataset consisting of some items that are continously added to the inventory and continously removed from the inventory. In this way each item has a start date and an end date (if removed) or the end date is empty. An example is given below. I want to create a graph with drill down where you on a given date can see how many items is on the inventory and by drilling down yoy can see the items. Any suggestions about how to accomplish this?
Item Start_date End_date
Item1 1/1-2015 30/4-2016
Item2 3/2-2015 2/2-2016
Item3 4/4-2016
Item4 5/1-2015 7/6-2015
Hi @Klarsen,
Here is an approach using an 'events in progress' type measure which is appropriate when your table has start and end dates.
(see this paper page 27: http://www.sqlbi.com/wp-content/uploads/DAX-Query-Plans.pdf)
Here is a Sample PBIX file
The measure looks like this.
Notes:
Inventory Count = SUMX ( GENERATE ( CALCULATETABLE ( SUMMARIZE ( Inventory, Inventory[Start_date], Inventory[End_date], "Rows", COUNTROWS ( Inventory ) ), ALL ( 'Date' ) ), INTERSECT ( DATESBETWEEN ( 'Date'[Date], Inventory[Start_date], Inventory[End_date] ), LASTDATE ( 'Date'[Date] ) ) ), [Rows] )
Hi There,
Please see this file here for the solution.
https://drive.google.com/open?id=0B5-C_3XrFPdOV19uNHlVQmNvcG8
Thanks & Regards,
Bhavesh
If you like my post, please hit the "Kudo" Button and mark it as solution.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
42 | |
40 |