Forum Discussion
Table Totals Manipulation
- 4 years ago
Hi Anonymous
Try this:
FYEO (Incorrect Total) = VAR MonthstoEOFY = CALCULATE ( MEDIAN ( DATES[02. FY Periods Remaining] ), KEEPFILTERS ( VALUES ( 'DATES'[Date] ) ) ) VAR MonthlyFYEO = [YTD Actual] + ( [YTD Actual Monthly Average] * MonthstoEOFY ) VAR TotalFYEO = SUMMARIZE ( DATES, DATES[02. Offset - CurMonth], "Month Total", MonthlyFYEO ) RETURN IF ( HASONEVALUE ( DATES[02. Offset - CurMonth] ), MonthlyFYEO, CALCULATE ( MonthlyFYEO, FILTER ( ALL ( DATES ), DATES[02. Offset - CurMonth] = "Oct-21" ) ) )If the values in DATES[02. Offset - CurMonth] column are in Date format then you can change the last row of the above code to:
FILTER ( ALL ( DATES ), DATES[02. Offset - CurMonth] = MAX(DATES[02. Offset - CurMonth] ))
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi Anonymous
Try this:
FYEO (Incorrect Total) =
VAR MonthstoEOFY =
CALCULATE (
MEDIAN ( DATES[02. FY Periods Remaining] ),
KEEPFILTERS ( VALUES ( 'DATES'[Date] ) )
)
VAR MonthlyFYEO = [YTD Actual] + ( [YTD Actual Monthly Average] * MonthstoEOFY )
VAR TotalFYEO =
SUMMARIZE ( DATES, DATES[02. Offset - CurMonth], "Month Total", MonthlyFYEO )
RETURN
IF (
HASONEVALUE ( DATES[02. Offset - CurMonth] ),
MonthlyFYEO,
CALCULATE (
MonthlyFYEO,
FILTER ( ALL ( DATES ), DATES[02. Offset - CurMonth] = "Oct-21" )
)
)
If the values in DATES[02. Offset - CurMonth] column are in Date format then you can change the last row of the above code to:
FILTER ( ALL ( DATES ), DATES[02. Offset - CurMonth] = MAX(DATES[02. Offset - CurMonth] ))
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/