Forum Discussion
FrankWe
Helper II
2 years agoProblem 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') )
FreemanZ
Super User
2 years agohi FrankWe ,
Constant Average Line is a standard built-in feature, check this:
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-analytics-pane
- FrankWe2 years ago
Helper II
Hi, thank you for this info, but I think the constant average line is not available for a stacked bar chart as I need this to show the different visit types in the bar. Sorry for not mentioning that. When I look into the analytics pane there is now average bar available.
The chart should look like the one below. The red line is the average line and it should change every time when I change the time period in the date slicer.