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
shayden
Frequent Visitor

Average Help

I have a reqeust to graph today's volume of calls against the 6 week historic average but only where the same Day Of Week (Monday = Monday) is averaged.  I have the following measures created, but need to figure out how to update the average to select only same day of week as the current date.

 

Average_Offered = AVERAGEX(VALUES(CRM_Interval_Day_V21[CallDate]),[Total_Offered])

 

Current_Offered = CALCULATE(SUM(CRM_Interval_Day_V21[InboundOffered]),FILTER(CRM_Interval_Day_V21,CRM_Interval_Day_V21[CallDate]=TODAY()))

 

I also added the Day name as a field in my data prep.  I am connecting to a PowerBI Online Service file, so I unfortunately can't bring in any additional tables or create a new table in my pbix.  Any advice would be greatly appreciated!

 

thanks

Steve

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may refer to my solution here.

 

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @shayden,

 

You can try to use weekday function to filter your table.

Average_Offered 6Week =
VAR current_Date =
    MAX ( CRM_Interval_Day_V21[CallDate] )
RETURN
    AVERAGEX (
        FILTER (
            ALLSELECTED ( CRM_Interval_Day_V21 ),
            WEEKDAY ( CRM_Interval_Day_V21[CallDate], 1 ) = WEEKDAY ( current_Date, 1 )
                && CRM_Interval_Day_V21[CallDate]
                >= current_Date - 42
                && CRM_Interval_Day_V21[CallDate] <= current_Date
        ),
        [Total_Offered]
    )

Reference:

WEEKDAY Function (DAX)

 

Regards,

Xiaoxin Sheng

Ashish_Mathur
Super User
Super User

Hi,

 

You may refer to my solution here.

 

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  This format worked.  I had to change some dates to reflect TODAY versus MAX('Date'), but I finally got it to work.  Thank you very much for your quick response!

 

Average_Offered_Weekday = AVERAGEX(FILTER(DATESBETWEEN(CRM_Interval_Day_V21[CallDate],MIN(CRM_Interval_Day_V21[CallDate])-43,TODAY()-1),WEEKDAY(CRM_Interval_Day_V21[CallDate],2)=WEEKDAY(TODAY(),2)),[Total_Offered])

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.