In tableau, you can create LODs that will bring back your Current vs Previous month sales. 5 calculations for your month difference is needed.
- Current Month - find your most recent month in the dataset:
{MAX(DATETRUNC("month",[Order Date]))}
- Previous Month - Finding the previous month from your current month:
DATEADD("month",-1,[Current Month])
- Current Month Sales - Using your calculations previously made, we can now find the sales within the current month. For this we need an IF Statement:
IF [Current Month] = DATETRUNC('month', [Order Date]) THEN [Sales]END
- Previous Month Sales - likewise for your previous month, this also requires an IF Statement:
IF DATETRUNC("month",[Order Date]) = [Previous Month] THEN [Sales]END
- MoM calculation - Final step is to create that difference calculation between your months:
(SUM([Current Month Sales])-SUM([Previous Month Sales]))/SUM([Previous Month Sales])
Now put your calculations into view