Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
@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 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@space83 , Try a measure like
CALCULATE(AVERAGE(Table[Total Days]),FILTER(Table, year(Table[Order Date]) =2020))
@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 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |