Using Time intelligence measure to filter data

psteps

New Member
Joined
Nov 13, 2014
Messages
4
Hi,

I have data table in PowerPivot that includes list of thousands of different retail items, their product categories, the date they were purchased, selling store, and their sale prices. I've created pivot table to cut the data, and slice by store, product category, etc. with the value being to show weighted ave price. For ex:


Average Selling Prices
Row Labels201220132014
Clothing
$14.3
$15.1
$16.9
Electronics
223
250
269
White Goods
522
543
601
Sporting Goods
25
27
29
Toys
15
17
12
Grand Total *
305.0
333.0
372.0

<tbody>
</tbody>

I’m now trying to filter the data such that the table calculates the average selling prices (ASPs) using only the first 100 items of each product (SKU) sold in every year. And I need this to be a fully dynamic measure, because I’ll want to analyze the data using different labels and slicers.


So for instance, I’ll want the table to calculate the average ASP for Clothing items, using only the selling prices of the first100 sweaters, t-shirts, and shorts sold in each year.I will later need to use this measure to display the initial ASP (ie, first 100 items sold) for the top 25 best-selling items of the year (ranked by total sales).I know how to use the TopN function, but not how to filter by time.


Could someone please lend a hand? Thank you!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
So here is where PowerPivot will shine as it sings.

Get yourself a calendar table. Here is a link with instructions to get one The Ultimate Date Table « PowerPivotPro

You can also create one pretty easily in Excel.

Caution: No need to bring every date since 1900 until 2099. Keep the calendar relevant to the data.

Once you have one in PP, link up your Invoice date you can really do some amazing things.

If your Sales Date column has an HH:mm time stamp, you might need to add a calculated column to make those reflect just the date.

I would highly recommend reading DAX Formulas for PowerPivot for a full breakdown of Time intelligence formulas and custom calendars as well

Once you are off to the races here, the sky is the limit.
 
Upvote 0
Helpful, thank you. But once I have a calendar table, what measure should i use to filter for the first 100 items per year?
 
Upvote 0
The TopN Filter should work just fine.

I understood your original question to be how to use that measure and filter by dates.

Our top 100 varies year to year so I also use RANKX to actually show the rank in a corresponding column for whatever year I am looking at
 
Upvote 0
I am looking for a measure that would filter the selling prices for the first 100 units sold in any given year, and exclude all other units sold after for that given year. I have my calendar table now, but I don't know how to construct the measure. Thanks again for the help..
 
Upvote 0
Once you have created the relationship between your sales date and your day column in your calendar, you can use all of the time intelligence measures.

I'm not quite sure if you want the first 100 transactions or the Top 100 Items.

Regardless you will want start with something along the lines of =CALCULATE([Total Sales],TOPN(100,tblProducts,[TotalSales])

Then drop Year, Qtr or whatever on a slicer and you should be headed in the right direction.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,205
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top