Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
laraibashfaq
Regular Visitor

Need help with time intelligence functionality

Hi,

I am creating a measure through which whatever date range is being selected in date filter get the max year for it and calculate the spend for that year for all Qtr's of which data is being present.

Kindly review the below measure which I have created and attachement and please suggest the way forward for it. I need the total spend for Max year disregard the date selected in filter.

 

MaxyearAmount =

VAR MAXyear =

CALCULATE( YEAR( MAX( 'Date'[DateValue] ) ), ALLSELECTED() )

VAR MinDate_MaxYear =

CALCULATE(

MIN( 'Date'[DateValue].[Year] ),

FILTER( 'Date', 'Date'[Year] = MAXyear )

)

VAR MaxDate_MaxYear =

CALCULATE(

MAX( 'Date'[DateValue].[Year] ),

FILTER( 'Date', 'Date'[Year] = MAXyear )

)

VAR MaxyearAmount =

CALCULATE(

[Spend],

FILTER(

'Date',

'Date'[DateValue].[Year] >= MinDate_MaxYear

&& 'Date'[DateValue].[Year] <= MaxDate_MaxYear

)

)

RETURN
MaxyearAmount
Query.jpg
2 REPLIES 2
ALLUREAN
Solution Sage
Solution Sage

Hi, @laraibashfaq 

 

Try something like:

 

MaxyearAmount =
VAR MaxYear =
CALCULATE (
MAX ( 'Date'[DateValue] ),
ALLEXCEPT ( 'Date', 'Date'[DateValue] )
)
RETURN
CALCULATE (
MAX ( [Spend] ),
FILTER (
ALLEXCEPT ( 'Date', 'Date'[DateValue] ),
'Date'[DateValue] = MaxYear
)
)

 

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Nops, this function doesn't work

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors