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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.