Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

R12 Month Questions

I am newer to PBI and having problems with R12 month DAX code. 

 

I am trying to find the rolling 12 month of concrete qty and want to see what they are monthly. I am using DAX code-- 

 

Last 12 Months =
CALCULATE ( [Concrete Qty],
      DATESINPERIOD ( 'Ticket'[Ticketed Date],          -- returns period from date column
                      MAX ( 'Ticket'[Ticketed Date] ),  -- starting from MAX date
                      -12,                   -- shifting it back 12 intervals
                      MONTH                  -- each interval being a month
      )
)

 

When I put these in a matrix with total Concrete QTY I am getting the same values. 

 

Can anyone tell me what I am doing wrong? 

 

1 Reply

  • Dangar332's avatar
    Dangar332
    Resident Rockstar

    HI, Anonymous 

     

    just adjust your table and  column name

    use below code instead of  MAX ( 'Ticket'[Ticketed Date] )


    calculate( MAX ( 'Ticket'[Ticketed Date] ),allexcept('yourtablename','ticket'[yearcolumnname]))