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
swestendorp
Helper I
Helper I

Graph shows rolling average for future months

Good day all, 

 

I can't wrap my head around the following issue. I've created a rolling 30 day measure. When visualing in a graph, values are shown for future months (when I use the date hierarchy). Obviously, I don't want these to be shown. How can I solve this? Your help is highly appreciated!

 

Capture.JPG

Final measure:

 

Rolling 30 days correct = IF(MAX(Dates[Date]) <= TODAY(),([Rolling30Days]), BLANK())

 

Created by following measures:

 

Rolling30Days = 1 - ([Rolling30Delay]/[Rolling30Voyages])

 

Rolling30Voyages =
CALCULATE (
    SUM ( VoyagesInPeriod[Duration] ),
    FILTER (
        ALLSELECTED ( 'Dates' ),
        'Dates'[Date] <= MAX ( 'Dates'[Date] )
            && 'Dates'[Date]
                > MAX ( 'Dates'[Date] ) - 30
    )
)

 

Rolling30Delay =
IF (
    ISBLANK ( CALCULATE ( SUM ( DelaysInPeriod[Duration] ) ) ),
    BLANK (),
    CALCULATE (
        SUM ( DelaysInPeriod[Duration] ),
        FILTER (
            ALLSELECTED ( 'Dates' ),
            'Dates'[Date] <= MAX ( 'Dates'[Date] )
                && 'Dates'[Date]
                    > MAX ( 'Dates'[Date] ) - 30
        )
    )
)

 

Thanks a bunch, 

Sifra

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi swestendorp,

 

You said "Obviously, I don't want these to be shown. How can I solve this? Your help is highly appreciated!"

<--- Which column is used as X-axis in your chart? Could you give some more details about your table structure and expected requirement? And if possible, can you provide a pbix file with dummy data for further analysis?

 

Regards,

Jimmy Tao

Hi @v-yuta-msft,

 

Thanks for your reply. In the meantime, we have found out that it has something to do with the last step, that is the '1 - ...'. This is causing Power BI to calculate for future months. I don't know however to solve this. 

 

On the X-axis I have used my date table: 

 

Dates =
CALENDAR ( DATE ( ( 2013 ), ( 01 ), ( 01 ) )TODAY () )

 

My data model looks like this:

 

image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thanks for your help.

 

Best regards,

Sifra

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.