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.
Hi All
I need help in creating a new column in my table (MaxValueWithinRange) where the value returned is the maximum value within a 12 month date range from a corresponding date in the row.
For example, if the date (in the "Date" column) is 17/09/2021, the date range I would want to look up the max value from would be 18/09/2020 to 17/09/2021. The max value within this range is 17407.
Please see example below of what I'm trying to achieve. Please note, the "From" and "To" columns are only in this example and not actually in my PBI table.
Many thanks
darls15
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pibx file.
It is for creating a new column.
MaxValueWithinRange CC =
VAR _rangeenddate = Data[Date]
VAR _rangestartdate =
DATE ( YEAR ( _rangeenddate ) - 1, MONTH ( _rangeenddate ), DAY ( _rangeenddate ) ) + 1
VAR _result =
MAXX (
FILTER ( Data, Data[Date] >= _rangestartdate && Data[Date] <= _rangeenddate ),
Data[TotalUsers]
)
RETURN
_result
Yes that's exactly it! It works perfectly with my data, thank you so much Jihwan_Kim 😊
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pibx file.
It is for creating a new column.
MaxValueWithinRange CC =
VAR _rangeenddate = Data[Date]
VAR _rangestartdate =
DATE ( YEAR ( _rangeenddate ) - 1, MONTH ( _rangeenddate ), DAY ( _rangeenddate ) ) + 1
VAR _result =
MAXX (
FILTER ( Data, Data[Date] >= _rangestartdate && Data[Date] <= _rangeenddate ),
Data[TotalUsers]
)
RETURN
_result
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |