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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JamesBurke
Helper III
Helper III

Daily Average

Hi all , 

 

 

Daily Average all = CALCULATE( AVERAGEX(
    VALUES('Date'[Day ID]),
    [Total Kwh]
),ALL('Date'))

 

 

Above Is the Dax forumla i'm using as a average of all days and then comparing todays usages aginst it and using conditonal formatting in green and red to show above and beow average usages. 

 

I Have now realised saturday and sunday where there is always lower consumption will always be green , i'm looking at making a similar dax measure that compares each invidual day to their Daily average of all dates. 

 

So For exmaple:

 

Day NameToday's UsagesDaily Average total Conditonal Formatting
Monday 109Red
Friday 1417Green
Sunday25Green

 

I have the Dax Measure For the conditonal Formatting just looking for a way to Breakdown the Daily Average of all dates to be broken down by Day Name rather then being one flat Value across all dates. 

 

Thanks , James. 

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@JamesBurke,

 

Try a measure like this. You could use ALLSELECTED instead of ALL if you want a date slicer/filter to apply to the calculation.

 

Daily Average by Day Name =
VAR vTable =
    CALCULATETABLE (
        VALUES ( 'Date'[Date] ),
        ALL ( 'Date' ),
        'Date'[Day Name] = MAX ( 'Date'[Day Name] )
    )
VAR vResult =
    AVERAGEX ( vTable, [Total Kwh] )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@JamesBurke,

 

Try a measure like this. You could use ALLSELECTED instead of ALL if you want a date slicer/filter to apply to the calculation.

 

Daily Average by Day Name =
VAR vTable =
    CALCULATETABLE (
        VALUES ( 'Date'[Date] ),
        ALL ( 'Date' ),
        'Date'[Day Name] = MAX ( 'Date'[Day Name] )
    )
VAR vResult =
    AVERAGEX ( vTable, [Total Kwh] )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights 

 

Thankyou ! 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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