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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RGR
Frequent Visitor

Display date of max value in matrix

Best all,

 

I'm looking for a way to display the date corresponding to the max. value in the "number' column.

Date123456number
20-1-2023 0,100,202,10-0,50-1,300
21-1-2023 4,200,002,00-2,60-3,401
22-1-2023 0,000,001,50-2,30-3,202
23-1-2023 0,300,003,901,301,203
24-1-2023 0,100,003,000,200,104
25-1-2023 0,100,000,20-2,00-1,805
26-1-2023 2,601,107,10-1,80-1,500
27-1-2023 0,100,005,102,702,401
28-1-2023 2,800,003,10-2,80-5,905
29-1-2023 0,200,004,60-4,30-5,103

 

The result of this should be: 25-01-2023 which is the first max. based on number,

or even better
The result of this should be: 25-01-2023 and 28-01-2023 which are both the max. based in number.

 

Hope anyone can help, thanks in advance!!
Best regards, RG

1 ACCEPTED SOLUTION

Hi , @RGR 

Thanks for your sample data  and  in my understand , you want to shows who has the max days each year , you can try to use this dax code:

Measure = var _cur_year =MAX(Blad1[Year])
var _max_days =MAXX( FILTER( ALLSELECTED('Blad1') , 'Blad1'[Year] = _cur_year) , [# days with(out) rain])
return
IF( MAX('Blad1'[# days with(out) rain]) = _max_days ,1,-1)

 

The result is as follows:

vyueyunzhmsft_0-1676424781091.png

 

 

If this method does not meet your needs, you can provide us with your special  desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

6 REPLIES 6
RGR
Frequent Visitor

Dear Aniya,

 

Hopefully this will do the trick.
Your help is much appreciated.

Best regards, RG

Hi , @RGR 

Thanks for your sample data  and  in my understand , you want to shows who has the max days each year , you can try to use this dax code:

Measure = var _cur_year =MAX(Blad1[Year])
var _max_days =MAXX( FILTER( ALLSELECTED('Blad1') , 'Blad1'[Year] = _cur_year) , [# days with(out) rain])
return
IF( MAX('Blad1'[# days with(out) rain]) = _max_days ,1,-1)

 

The result is as follows:

vyueyunzhmsft_0-1676424781091.png

 

 

If this method does not meet your needs, you can provide us with your special  desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Dear Aniya,

Again, many thanks!! 
Your solution works perfect for me (once I figured out that you added a column 'year') 🙂

Best regards,
RG

v-yueyunzh-msft
Community Support
Community Support

Hi , @RGR 

According to your description, you want to show the max of the number data in the table.

If this , here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1676256721231.png

(2)We can click "New Measure" and enter this:

Measure = var _max_number =MAXX(ALLSELECTED('Table') ,[number])
return
IF(MAX('Table'[number])  =  _max_number ,1,0)

 

(3)Then we can put the measure on the "Filter on this visual" and configure it and we can meet your need:

vyueyunzhmsft_1-1676256767029.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Dear Aniya

Thank you very mucht for your reply, I think it comes close to what I'm looking for.
I have an excel sheet, so you can get a better understanding of my question. Only how to send it to you??

 

Best regards, RG

Hi, @RGR 

You can  upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me !

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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