cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Reuben
Helper III
Helper III

get the date with highest value

Hi experts,

I want to get the date where there is the highest value. In the example below the highest value is 15 so the desire result shoud be 11/10/2021.

To get a differente colour Im using the following expression, but I dont know how to get the date itself

 

Maxvalue =
var alldateincontext= ALLSELECTED('Calendar'[Date]
var themaxvalue = MAXX(alldateincontext, measuretable[numberofpeople])
return
IF(measuretable[numberofpeople] = themaxvalue,"#ff6600")

 

Reuben_1-1637326145391.png

 

Thank you!!

1 ACCEPTED SOLUTION
VahidDM
Community Champion
Community Champion

Hi @Reuben 

 

try this:

MaxDate=
var alldateincontext= ALLSELECTED('Calendar'[Date]
var themaxvalue = MAXX(alldateincontext, measuretable[numberofpeople])
return
Calculate(max('Calendar'[Date]), filter(all(measuretable),measuretable[numberofpeople]=themaxvalue))
 

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/


 

View solution in original post

1 REPLY 1
VahidDM
Community Champion
Community Champion

Hi @Reuben 

 

try this:

MaxDate=
var alldateincontext= ALLSELECTED('Calendar'[Date]
var themaxvalue = MAXX(alldateincontext, measuretable[numberofpeople])
return
Calculate(max('Calendar'[Date]), filter(all(measuretable),measuretable[numberofpeople]=themaxvalue))
 

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/


 

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors