Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Need Max value month wise from last 2 years selected from the slicer

Hi All,

 

I want maximum Value in each month from last 2 year comparison. Kindly help me if data is like below 

bhuprakash_0-1709015826687.png

 

2 ACCEPTED SOLUTIONS
Daniel29195
Super User
Super User

Syndicated - Outbound

@Anonymous 

write the following measure : 

(this will take into consideration current year and previous year ) 

m = 

var currentyear = year ( today() )

var ds = 

filter ( 

tbl_name ,  year >= currentyear -  1 )

RETURN

maxx( ds , value ) 

 

NB: if you want to take only prev 2 years excluding the current year,  change the filter to this : 

var ds = 

filter ( 

tbl_name ,  year >= currentyear -  2 && year < currentyear )

 

 

tbl_name being the table containing your data, and value being the column name with the values you want to display .

 

 

hope this helps .

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

View solution in original post

Kishore_KVN
Super User
Super User

Syndicated - Outbound

Hello @Anonymous please create below measure

Max Value = CALCULATE(MAXX('Table','Table'[Value]),ALLEXCEPT('Table','Table'[Month]))

Kishore_KVN_0-1709017354902.png

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

 

View solution in original post

4 REPLIES 4
avatar user
Anonymous
Not applicable

Syndicated - Outbound

hank kyou so much @Kishore_KVN  for the help

Kishore_KVN
Super User
Super User

Syndicated - Outbound

Hello @Anonymous please create below measure

Max Value = CALCULATE(MAXX('Table','Table'[Value]),ALLEXCEPT('Table','Table'[Month]))

Kishore_KVN_0-1709017354902.png

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

 

Daniel29195
Super User
Super User

Syndicated - Outbound

@Anonymous 

write the following measure : 

(this will take into consideration current year and previous year ) 

m = 

var currentyear = year ( today() )

var ds = 

filter ( 

tbl_name ,  year >= currentyear -  1 )

RETURN

maxx( ds , value ) 

 

NB: if you want to take only prev 2 years excluding the current year,  change the filter to this : 

var ds = 

filter ( 

tbl_name ,  year >= currentyear -  2 && year < currentyear )

 

 

tbl_name being the table containing your data, and value being the column name with the values you want to display .

 

 

hope this helps .

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

avatar user
Anonymous
Not applicable

Syndicated - Outbound

thanks @Daniel29195 , it also working for me.

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)