Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
121 | |
79 | |
48 | |
38 | |
31 |
User | Count |
---|---|
192 | |
79 | |
70 | |
50 | |
42 |