98.8% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » DAX Calculate
DAX Calculate
Resolved · High Priority · Version 365
Tsudoi has attended:
Excel PowerPivot course
Excel VBA Introduction course
DAX Calculate
How can I get last year sales in the same row as this year sales in pivot table (=keeping external filter alive) using Calculate function?
If I use SAMEPERIDOLASTYEAR and have external filter 2020, the value shows in 2019 row, not in the same row as 2020. I want to show 2020 and 2019 sales values in the same row in the same pivot table.
There must be some row contact filtering that I can apply to Calculate function but I don’t know how. Please can you advise?
Thanks,
RE: DAX Calculate
Hi Tsudoi,
Thank you for the forum question.
If you filter your PivotTable to show 2020 and both have your sales measure (Total Sales:=sum(SalesTable[Sales amount])) and your Calculate (Sales Last Year:=Calculate([Total Sales],Sameperiodlastyear(DateTable[DateKey]))) as values in the PivotTable then the PivotTable should show 2020 sales in the Total Sales column and in the same row but in the "Sales Last Year" column the total sales for 2019.
As far as I remember you are working with one large table and a DateTable in your model.
When you are talking about external filter I assume that you mean a slicer or you have added "Year" to Filter in the PivotTable Fields pane.
Please let me know if I misunderstand your issue.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: DAX Calculate
Many thanks Jens
RE: DAX Calculate
You are welcome Tsudoi
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Mon 4 May 2020: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Formst Excel to display leading zeroesSelect the cells that you want to have displaying leading zeroes. |