March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
168 | |
116 | |
63 | |
57 | |
50 |