Forum Discussion

jfowings1's avatar
jfowings1
Regular Visitor
2 years ago
Solved

Need help with DAX Measure for Average Per Day

Hello, I've been working in Power BI only a few months..   I am trying to create a matrix that shows the average number of good leads by Inventory Product Type, placement type and then columns are fi...
  • rcarroll's avatar
    rcarroll
    2 years ago

    Okay, got it.
    You can start by creating a general measure for your 'Good Leads' sum:

     

     

    Total Good Leads = 
    SUM('Historical Data'[Good Leads])

     

     

    Then you can pass it into a measure that groups those sums and provides the average within the context of each unique date:

     

     

    Average Good Leads Per Day = 
    
    VAR distinctDates_TABLE = VALUES( Dates[Date] )
    
    VAR result = AVERAGEX (
        distinctDates_TABLE,
        [Total Good Leads]
    )
    
    RETURN result

     

     

    The result of this value can then be used by itself, such as on a card visual, to return the total average of good leads per date, or you can use a matrix visual to further group the calculation within the context of other categories, such as inventory type, placement, month, etc.