Forum Discussion

Reetz's avatar
Reetz
Icon for Helper II rankHelper II
7 years ago
Solved

% change from prior month

 I have a table (tbl_USA_Canada) with 3 columns. Date, Territory and % of Sales. I am trying to display the Territory with the % change of sales from the prior month and can't seem to get this to wor...
  • Ashish_Mathur's avatar
    7 years ago

    Hi,

    Assuming the entries in the Date column of tbl_USA_Canada Table are proper date entries, try this

    1. Create a Calendar Table
    2. Enter these calculated column formulas in the Calendar Table - Year = YEAR(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm")
    3. Build a relationship from the Date column of the tbl_USA_Canada Table to the Date column of the Calendar Table
    4. In your visual, drag Year and Month from the Calendar Table
    5. Write these measures - Percent of Sales = SUM(Data[% of slaes]) and Percent of Sales in previous month = CALCULATE([Percent of Sales],PREVIOUSMONTH(Calendar[Date]) and Delta = IFERROR([Percent of Sales]/[Percent of Sales in previous moths]-1,BLANK())

    Hope this helps.