Forum Discussion

aaande8's avatar
aaande8
Frequent Visitor
6 years ago
Solved

How to remove current month reporting in Power Pivot

I have a report that I want to pull in a rolling 12 months. However, I also need it to not pull in  the data for the current month as month end reporting happens halfway into the current month.  I ha...
  • v-juanli-msft's avatar
    6 years ago

    Hi aaande8 

    My previous answer show specific rolling 12 months values:

    for current month, 2019/9, the rolling 12 month values is from 2018/10~2019/8, not including current month.

     

    If you'd like there is no value showing at X-axis =2019/9 , 

    You could create a measure as below

     

    Measure =
    VAR currentday =
        MAX ( 'calendar'[Date] )
    RETURN
        CALCULATE (
            SUM ( 'Table'[sales] ),
            FILTER (
                ALLSELECTED ( 'calendar' ),
                DATEDIFF ( currentday, 'calendar'[Date], MONTH ) >= -11
                    && DATEDIFF ( currentday, 'calendar'[Date], MONTH ) <= 0
                    && 'calendar'[Date] <= MAX ( 'calendar'[Date] )
            )
        )
    
     
    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.