Forum Discussion
Issues Calculating Offset Calendar
- Anonymous2 years ago
Hi, UnknownUser1702
Based on your information, I create a sample table:
Then create calculated columns, here is the following DAX:AdjustedYear current = VAR CurrentYear = YEAR('Date'[Date]) VAR CurrentMonth = MONTH('Date'[Date]) VAR AdjustedYear = IF( MAX('Account'[Custom_Fiscal_Year]) = "Current Year", IF(CurrentMonth >= MAX('Account'[Custom_Start_Month]), CurrentYear + 1, CurrentYear), IF(CurrentMonth >= MAX('Account'[Custom_Start_Month]), CurrentYear, CurrentYear - 1) ) RETURN AdjustedYearAdjustedYear next = VAR CurrentYear = YEAR('Date'[Date]) VAR CurrentMonth = MONTH('Date'[Date]) VAR AdjustedYear = IF( MAX('Account'[Custom_Fiscal_Year]) = "Next Year", IF(CurrentMonth >= MIN('Account'[Custom_Start_Month]), CurrentYear + 1, CurrentYear), IF(CurrentMonth >= MIN('Account'[Custom_Start_Month]), CurrentYear, CurrentYear - 1) ) RETURN AdjustedYearI've created a few other calculated columns to compare, such as the largest start month, and so on. Here is my preview:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, UnknownUser1702
Based on your information, I create a sample table:
Then create calculated columns, here is the following DAX:
AdjustedYear current =
VAR CurrentYear = YEAR('Date'[Date])
VAR CurrentMonth = MONTH('Date'[Date])
VAR AdjustedYear =
IF(
MAX('Account'[Custom_Fiscal_Year]) = "Current Year",
IF(CurrentMonth >= MAX('Account'[Custom_Start_Month]), CurrentYear + 1, CurrentYear),
IF(CurrentMonth >= MAX('Account'[Custom_Start_Month]), CurrentYear, CurrentYear - 1)
)
RETURN AdjustedYear
AdjustedYear next =
VAR CurrentYear = YEAR('Date'[Date])
VAR CurrentMonth = MONTH('Date'[Date])
VAR AdjustedYear =
IF(
MAX('Account'[Custom_Fiscal_Year]) = "Next Year",
IF(CurrentMonth >= MIN('Account'[Custom_Start_Month]), CurrentYear + 1, CurrentYear),
IF(CurrentMonth >= MIN('Account'[Custom_Start_Month]), CurrentYear, CurrentYear - 1)
)
RETURN AdjustedYear
I've created a few other calculated columns to compare, such as the largest start month, and so on. Here is my preview:
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.