Forum Discussion

mpmsltd's avatar
mpmsltd
Icon for Helper I rankHelper I
6 years ago
Solved

Look back 365 days calculation

Hi everybody, I have a table with dates, dollar value and category of each transaction. I want to see my margin for the past 12 months - but each data point on my chart (example below) should calc...
  • v-chuncz-msft's avatar
    6 years ago

    mpmsltd 

     

    Add a calendar table and build relationship, then add measure below.

    Measure =
    CALCULATE (
        SUM ( 'Table'[total] ),
        DATESINPERIOD ( 'Calendar'[date], MAX ( 'Calendar'[Date] ), -12, MONTH ),
        'Table'[category] = "sale"
    )