Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Let's say I have the below data:
Date | Total |
10/25/2021 | 14 |
11/2/2021 | 42 |
12/7/2021 | 31 |
1/16/2022 | 51 |
1/18/2022 | 57 |
4/21/2022 | 72 |
6/21/2022 | 43 |
7/4/2022 | 27 |
How can I create a custom column that will average the numbers in a specific date range?
i.e. create a column with (sudo):
if [Date] between 10/01/2021 and 12/31/2021 then AVERAGE(Total) else if [Date] between 1/01/2022 and 7/31/2022 then AVERAGE(Total)
Or something similar to that?
You can create a custom column using the following steps:
This formula checks if the date falls within the range of 10/01/2021 and 12/31/2021, and returns the average of the total column for that date range. If the date falls within the range of 1/01/2022 and 7/31/2022, it returns the average of the total column for that date range. If the date falls outside of those date ranges, it returns a blank value.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you! This helps a bunch. But the issue that I am getting is that they are still just averaging all of them, despite specifying the date ranges.
I think it is because it is looking for [Date] >= DATE(2021, 10, 1), and since they are all greater than or equal to that, it is just looking at that and averaging every row.
Any suggestions to stop that?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
67 | |
61 | |
46 | |
45 |