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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.