Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |