Barhomopolis
New Member
- Joined
- Jan 10, 2012
- Messages
- 21
Hello Everyone,
I have this dataset (click here) of items with time stamped stages. Some stages mean the item is occupying space in the storage. The other stages mean it's not. I need to use Power Pivot 2016 (not Power BI) to produce the chart below for avg. storage occupancy over time for the same time period of the same week day (we call it "time of week" for short). For instance, the chart should answer the question, "How many items on average do we have in storage on Sundays between 12 & 4 PM?" I also need to show percentiles on the same chart as below.
Before going into averages and percentiles, I first tried to create this measure to calculate the occupancy itself at any given "time of week":
I was getting negative numbers, which is impossible. Then I realised I have to include items that entered the storage in the past and haven't left yet, but I couldn't figure out how to do it in Power Pivot 2016. It looks like there are new DAX functions in Power BI that do just this, but we can't use Power BI.
When I tried to calculate it in a calculated column:
I got an out of memory error, although the dataset is fewer a hundred thousand rows.
I would appreciate the help.
I have this dataset (click here) of items with time stamped stages. Some stages mean the item is occupying space in the storage. The other stages mean it's not. I need to use Power Pivot 2016 (not Power BI) to produce the chart below for avg. storage occupancy over time for the same time period of the same week day (we call it "time of week" for short). For instance, the chart should answer the question, "How many items on average do we have in storage on Sundays between 12 & 4 PM?" I also need to show percentiles on the same chart as below.
Before going into averages and percentiles, I first tried to create this measure to calculate the occupancy itself at any given "time of week":
SQL:
Occupancy:=CALCULATE(DISTINCTCOUNT('Source data'[ItemKey]),'Source data'[Stage] <> "Arrival" && 'Source data'[Stage] <> "Transport"),'Source data'[DateKey]))-CALCULATE(DISTINCTCOUNT('Source data'[ItemKey]),'Source data'[Stage] = "Arrival" || 'Source data'[Stage] = "Transport")
I was getting negative numbers, which is impossible. Then I realised I have to include items that entered the storage in the past and haven't left yet, but I couldn't figure out how to do it in Power Pivot 2016. It looks like there are new DAX functions in Power BI that do just this, but we can't use Power BI.
When I tried to calculate it in a calculated column:
SQL:
=CALCULATE(DISTINCTCOUNT('Source data'[ItemKey]),'Source data'[Stage] <> "Arrival" && 'Source data'[Stage] <> "Transport",'Source data'[DateKey]<=EARLIER('Source data'[DateKey]))-CALCULATE(DISTINCTCOUNT('Source data'[ItemKey]),'Source data'[Stage] = "Arrival" || 'Source data'[Stage] = "Transport",'Source data'[DateKey]<=EARLIER('Source data'[DateKey]))
I got an out of memory error, although the dataset is fewer a hundred thousand rows.
I would appreciate the help.