Compute revenue earned in all Fridays of previous month

Hi,

In this workbook (http://1drv.ms/1ed7ieF). I have a simple "Revenue" measure which I have computed as:

=SUM(sales_data[Total Price])

I also have a measure titled as "Revenue in previous month" which is computed as:

=CALCULATE([Revenue],PREVIOUSMONTH(calendar[Date]))

Now I also have two slicers - one in which the user can select Day of week and another in which he/she can select Portion of Month i.e. First half of month or second half of month.

Without any slicer selections, both measure work perfect.  But if I select Monday in the slicer (to compare the revenue on Mondays of each month i.e. Revenue on all Mondays in April v/s Revenue on all Mondays in March), then the figures for "Revenue in previous month" still show Revenue for the entire previous month thereby obscuring the analysis.  The same problem happens when I select something in the Portion of the month slicer as well.  Figures for the Revenue measure appear correct no matter what selection I make in the slicer.

I think the PREVIOUSMONTH() function is not reading the slicer selections at all.

Please help me to modify the formula for the measure "Revenue in previous month" such that slicer selections are also considered.

Thank you.

July 20th, 2015 11:06pm

What if you add Day of Week to your pivot table/power view (matrix)? Is the Revenue in previous month calculated correctly for these lines or not?
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 12:34am

Hi,

Thank you for replying.  No, it is not.  When I drag Day of week in the Row labels (in addition to already having Month there), every row of the Day of week is showing me the revenue for the whole of the previous month.

Please help.

July 21st, 2015 12:38am

By selecting a single day the prereq. of a continous date range is broken, therefore time intelligence functions might not work properly (although they should be so nice and throw error messages :-)

Have a look here: http://www.daxpatterns.com/time-patterns/

They show how to build time patterns without TI-functions. 

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 2:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics