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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Max of Summarized column of rolling sum - DAX

Hi all,

I have two tables. A date table (Date) and Shipping table (table 0). In the shipping table I am calculating the a 12 month rolling sum and then trying to take a MAX value of that measure. I am using the formula below

 

Max12M = CALCULATE
                              (MAXX
                                   (SUMMARIZECOLUMNS(Date2[YearMonthnumber]),
                                        CALCULATE(
                                                 SUM('Table 0'[LBS SHIPPED]))),
                                                   DATESINPERIOD(Date2[Date],
                                                      LASTDATE(Date2[Date]),
                                                                 -11,MONTH))

 

It worked fine until now, and by selecting the 'Year' slicer from the date table I could look at the rolling sums and a Max value of the last 12 months. But since Jan 2019, It is giving me a blank result as out put for Max value. But If I select the 'month' as a slicer it is doing the math (see attached). I am not sure why this is happening. Any thoughts?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured it out. Thanks for the response.

 

The LASTDATE[Date2(Date)] was picking up the last date of 2019 (i.e 31 Dec 2019, I think). I changed that to the datefield from the fact table and it picked up the LastDate of the filter context. 

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 



But since Jan 2019, It is giving me a blank result as out put for Max value. But If I select the 'month' as a slicer it is doing the math (see attached). 

Did you mean since Jan 2019, the measure didn't work as before while you didn't make any change to the report? Is there any update to the data records of date table and Shipping table? If possible, could you share your sample .pbix file for test?

 

Regards,

Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I figured it out. Thanks for the response.

 

The LASTDATE[Date2(Date)] was picking up the last date of 2019 (i.e 31 Dec 2019, I think). I changed that to the datefield from the fact table and it picked up the LastDate of the filter context. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.