Forum Discussion
FrankWe
2 years agoHelper II
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...
- 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') )
sjoerdvn
2 years agoSolution Sage
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')
)FrankWe
2 years agoHelper II
@sjoerdvn: Many thanks for your help. You are my hero 😊 And it shows me that I will have to learn so much more to understand more of the DAX functionality 🤔