PowerPivot: calculate previous year value if date formatted as text

illusionek

Board Regular
Joined
Jun 21, 2014
Messages
104
I am using below measure, which works fine, the date in MonthYear is dd/mm/yyyy. I have got now a challenge where I need to display MonthYear on PivotCharts as MMM-YY

I went to Format Axis -> Number and tried to Add custom format but it doesn't get applied as a matter of fact I am unable to change the formatting at all even if I select some pre-definied options.

So next thing I did was calculated column where I used FORMAT to change MonthYear, which worked well but now my measure doesn't work when I use new calculated column in the chart.

I just cant get my head around how to change below measure to work with new calculated column

Excel Formula:
=CALCULATE([Actual Inv],DATEADD(qryMerge[MonthYear],-1,YEAR))
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The correct way to work with dates is to use a date column to connect to a calendar table, then use the calendar table to meet your formatted reporting needs.
Here are some of my articles.
 
Upvote 0
It has worked with the calendar table indeed. Just for mu benefit would you be able to explain why my initial formula worked without the calendar table but revised one doesn't?
 
Upvote 0
You can only display data on rows/columns if that data exists in you model. Excel uses a trick under the hood to generate a basic hidden calendar table to show Months and Years. But it is not a full calendar table. There is no MMM-YY column in the auto calendar table. This "trick" is actually a pain in my view. It confuses people and prevents them from learning how to do it properly. JMO
 
Upvote 0

Forum statistics

Threads
1,223,872
Messages
6,175,100
Members
452,613
Latest member
amorehouse

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