Forum Discussion

Rocky_Brown's avatar
Rocky_Brown
Icon for Helper I rankHelper I
4 years ago

Prior Year Sales Data

I have a sales table that has Fiscal Month, and Fiscal Year as Numeric fields.  I am interested in getting the prior year sales data from those columns.

 

I tried creating a measure:

Prior Yr Sales =

CALCULATE(SUM('Historic Commissions Data'[NetSales),

PreviousYear('Historic Commissions Data'[Fiscal Year]))

 

However, due to the [Fiscal Year] column being a numeric field, not a date field, it doesn't work.

 

Is there another way of getting this data?

 

Thank you,

5 Replies

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Rocky_Brown ,

     

    Please try this:-

    Prior Yr Sales =
    CALCULATE (
        SUM ( 'Historic Commissions Data'[NetSales] ),
        FILTER (
            'Historic Commissions Data',
            'Historic Commissions Data'[Fiscal Year]
                = YEAR ( TODAY () ) - 1
        )
    )

     

    Thanks,

    Samarth

    • Rocky_Brown's avatar
      Rocky_Brown
      Icon for Helper I rankHelper I

      I need the prior year sales data to coincide with the prior year fiscal period.  This doe not work, thank you, though