Return Total in Current Time Period (DAX)

dalexand

New Member
Joined
Apr 25, 2017
Messages
2
Greetings,

I expect there is an easy solution to my query that is currently evading me. What I am trying to do is calculate the sum of a quantity, say Sales, over the last 4 months. The catch is, I want the total quantity to be displayed on the current month on the pivot, leaving the previous months blank. So if January - April Sales are 10,000, I would want all 10,000 to show in April.
Any assistance is much appreciated.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Thanks Matt. Ideally, the time frame would be adjustable, so I could pull out the last 3 or 5 months. A simple YTD measure is a step in the right direction, but on a pivot with months, it would return a YTD for each month--- in my scenario I would return the total only in the current month, leaving the preceding months on the pivot table blank. Hope that makes sense.
 
Upvote 0
take your data to PowerPivot window


add two columns


first column enter formula =FORMAT(Table1[Date],"mmm")
second column enter formula =IF(MONTH(Table1[Date])=4,Table1[Sales],0)


click on PivotTable icon > place first column in Rows area > second column in Values area
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,728
Members
453,368
Latest member
positivemind

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