cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
atulj10 Regular Visitor
Regular Visitor

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

Accepted Solutions
atulj10 Regular Visitor
Regular Visitor

Re: Max of Summarized column of rolling sum - DAX

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
Microsoft v-yulgu-msft
Microsoft

Re: Max of Summarized column of rolling sum - DAX

Hi @atulj10,

 



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.
atulj10 Regular Visitor
Regular Visitor

Re: Max of Summarized column of rolling sum - DAX

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors