Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DBQuser1218
New Member

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. 

 

DBQuser1218_0-1698506078948.png

Can anyone tell me what I am doing wrong? 

 

1 REPLY 1
Dangar332
Super User
Super User

HI, @DBQuser1218 

 

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]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.