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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
738o51
Helper II
Helper II

Different Rolling Average Timing show the same result

 https://www.dropbox.com/s/zo33se3wtimyyzo/pbix%20for%20forum.pbix?dl=0

^.pbix

 

Hi all,

 

I am building a report that needs to show a graph with average census per weekday, overlayed with three rolling averages with different timeframes. You can see my attempt in the .pbix above. I also need these metrics to be filterable by census location and type.

 

My problem is that each of my averages is showing the same timeframe that is selected in the date slicer. I've used various attempts at all/allselected, but I end up with either rolling average that don't go beyond the slicer dates, or not responsive to weekdays.

 

Can some one please help?

 

Thanks!

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @738o51 ,

I'd like to suggest you apply all filter on ram table o ignore filter effect form calendar table:

1 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7
    )
)

2 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7*2
    )
)

3 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7*3
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @738o51 ,

I'd like to suggest you apply all filter on ram table o ignore filter effect form calendar table:

1 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7
    )
)

2 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7*2
    )
)

3 Week Rolling Average = 
CALCULATE (
    AVERAGE ( CensusOcc[Census] ),
    FILTER (
        ALL ( 'CensusOcc' ),
        'CensusOcc'[Date] < MAX ( 'Date'[Date] )
            && 'CensusOcc'[Date]
                >= MAX ( 'Date'[Date] ) - 7*3
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

738o51.PNGHi @738o51 ,

 

Please use Edit interactions option to stop the interaction between slicer and graph.

 

Click on Date Slicer, Go to Format (Top Ribbon) and then Edit Interactions.

 

Hope this will help.

 

Best Regards,

Gaurav Raj Singh

 

rajulshah
Super User
Super User

Hello @738o51,

 

You need to remove Interaction from slicer and the graph via Format > Edit Interactions.

It is because the graph is filtered by the slicer.

 

Hope this helps.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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