Forum Discussion
space83
Helper IV
5 years agocalculate average by selected year
Below is example of my data source: How can I create measure to calculate average 'TotalDays' for year 2020? I can do it simply in mssql but in DAX it become more complicated.
- 5 years ago
space83
Create this measure if you do not have a date table linked.Avg Total Days = CALCULATE( AVERAGE(Table[Total Days]), FILTER( 'Table1', Table1[Order Date] >= DATE(2020,1,1) && Table1[Order Date] <= DATE(2020,12,31)) )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
- 5 years ago
space83 , Try a measure like
CALCULATE(AVERAGE(Table[Total Days]),FILTER(Table, year(Table[Order Date]) =2020))
amitchandak
Super User
5 years agospace83 , Try a measure like
CALCULATE(AVERAGE(Table[Total Days]),FILTER(Table, year(Table[Order Date]) =2020))