Forum Discussion

FrankWe's avatar
FrankWe
Helper II
2 years ago
Solved

Problem with DAX query calculating an average value

Hello,  I have a problem to create a DAX measure calculating an average value.  I have a combined bar and line chart. The bars are showing the total numbers of rows in a table "visits" per month on...
  • sjoerdvn's avatar
    sjoerdvn
    2 years ago

    since you're not using a measure, you have to add a calculate to force the context.

    VAR AverageVisits2 = 
    CALCULATE(
        AVERAGEX(
            VALUES('Calendar'[MonthYear]),
            CALCULATE(COUNT(Visits[VisitID])))
       ,ALLSELECTED('Calendar')
    )