Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have table in BI that has all our clients data and I am having a hard time creating a column called Prior Year Rate.
I have the following table except for the Prior Year Rate.
The 1st 3 columns are from the dataset, I added Expected Renewal Date as a calculated column of Expiration Date +1.
I have tried to add the Prior Year Rate but cannot find a way to do it. Its probably a simple solutions that is just escaping me.
Thanks for any help
|
Solved! Go to Solution.
@flyfisher63 Try this:
Prior Year Rate Measure =
VAR __PolicyHolder = MAX( 'Table'[PolicyHolder] )
VAR __Date = MAX( 'Table'[Effective Date] )
VAR __PreviousDate =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] < __Date
),
[Effective Date]
)
VAR __Result =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] = __PreviousDate
),
[Current Year Rate]
)
RETURN
__Return
As a calculated column:
Prior Year Rate Measure =
VAR __PolicyHolder = [PolicyHolder]
VAR __Date = [Effective Date]
VAR __PreviousDate =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] < __Date
),
[Effective Date]
)
VAR __Result =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] = __PreviousDate
),
[Current Year Rate]
)
RETURN
__Return
Hi, As @Greg_Deckler mentioned, you can create the measure or a calculated column. In adition, if you need to have previous row value simply in a visual, then you can use Visual Calculation also.
in the visual calculation, you can use PREVIOUS function.
Hope this helps.
If this helps to resolve your problem, then please mark it as solution.
Thanks - Samrat
Hi @flyfisher63
Just checking in to see if the previous response helped resolve your issue. If not, feel free to share your questions and we’ll be glad to assist.
Hi @flyfisher63
Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.
Please specify if you want that as Power Query code, as a calculated column, or as a measure.
@flyfisher63 Try this:
Prior Year Rate Measure =
VAR __PolicyHolder = MAX( 'Table'[PolicyHolder] )
VAR __Date = MAX( 'Table'[Effective Date] )
VAR __PreviousDate =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] < __Date
),
[Effective Date]
)
VAR __Result =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] = __PreviousDate
),
[Current Year Rate]
)
RETURN
__Return
As a calculated column:
Prior Year Rate Measure =
VAR __PolicyHolder = [PolicyHolder]
VAR __Date = [Effective Date]
VAR __PreviousDate =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] < __Date
),
[Effective Date]
)
VAR __Result =
MAXX(
FILTER(
ALL( 'Table' ),
[Policyholder] = __Policyholder &&
[Effective Date] = __PreviousDate
),
[Current Year Rate]
)
RETURN
__Return
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 8 | |
| 7 |