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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |