Here’s a sample of the data. I have my date column tied back to my date table. Ultimately, I would be setting the avg. sale price per unit after the month finished but need to be able to set it by month.
Created a Calendar table that had date, month and year and related that to your main table. Be sure to use the columns from the calendar table for any filters (rows, columns, slicers, etc.)
Created the following three measures:
Sum of the Avg Sale Price Per unit column Total of Avg Sale = sum ( Table1[Avg Sale Price Per Unit] )
Then a countrows measures: # of Rows = COUNTROWS(Table1)
Then a measure to divide them out: Tot Avg Sale Divided by Rows = DIVIDE( [Total of Avg Sale], [# of Rows] )
@Nick_M I should have mentioned but this doesn’t work as the Average Sale Price Per Unit is a measure that is already created within my model. The formula of that measure is:
Avg Sale Price Per Unit = CALCULATE(DIVIDE(SUM(‘Warranty_Costs’[Net_Sales]),[Total Warranty Cores],1),ALLSELECTED(Warranty_Costs))
Here’s the costs and date table that I’m using for the calculation.
@nnouchi,
I think i see what you are saying, but not 100% clear. Could you do a quick mock up of what you would want to see? I have an idea, but want to be sure it’s what you had in mind before I spend too much time on it.
@Nick_M
I actually was able to figure out what I needed to do to make this measure work.
I used my [Avg Sale Price Per Unit] measure and specified to return filters on a new Month/year column I created through my Query Editor.
Avg Price Per Core By Month = CALCULATE([Avg Sale Price Per Unit],ALLEXCEPT(Warranty_Costs,Warranty_Costs[Month/Year]),VALUES(Warranty_Costs[Month/Year]))