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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
JustDavid
Helper IV
Helper IV

Get the MIN or MAX from Measures

Hello,

 

I'm new to Power BI and am trying to get the MAX and/or MIN value from the Measures that I create.


As seen from the print screen, I'm trying to get the MIN or MAX from each row of product type from measure [Avg. Amount].

 

My desired result is the red box in the screen that I need to be in measures as well.

 

I have attach a very small sample size of the power bi file, but note that the MIN and MAX in the file is not working as to what I desire in the screenshot below

 

Get MIN or MAX from Measures - Desired Result.png

https://www.dropbox.com/scl/fi/28m50ju0392fjxdzfl6vf/MIN-and-MAX-from-Measures.pbix?rlkey=41vpj3k118... 

 

 

 

1 ACCEPTED SOLUTION

Hi,

Try these measures

MIN = if(ISBLANK([Avg. Amount]),BLANK(),MINX(GENERATE(ALLSELECTED(tblDate[Fiscal Year],tblDate[Fiscal Quarter]),ALLSELECTED(tblData[MPC],tblData[Product Type])),[Avg. Amount]))
MAX = if(ISBLANK([Avg. Amount]),BLANK(),MAXX(GENERATE(ALLSELECTED(tblDate[Fiscal Year],tblDate[Fiscal Quarter]),ALLSELECTED(tblData[MPC],tblData[Product Type])),[Avg. Amount]))

Hope this helps.

Ashish_Mathur_0-1733785641446.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
JustDavid
Helper IV
Helper IV

@AnkitaaMishra and @Ashish_Mathur 

 

I have update my post with updated screenshot with my desired result and attach a small sample size pbix file.

 

Thanks for your help in advanced

Hi,

Try these measures

MIN = if(ISBLANK([Avg. Amount]),BLANK(),MINX(GENERATE(ALLSELECTED(tblDate[Fiscal Year],tblDate[Fiscal Quarter]),ALLSELECTED(tblData[MPC],tblData[Product Type])),[Avg. Amount]))
MAX = if(ISBLANK([Avg. Amount]),BLANK(),MAXX(GENERATE(ALLSELECTED(tblDate[Fiscal Year],tblDate[Fiscal Quarter]),ALLSELECTED(tblData[MPC],tblData[Product Type])),[Avg. Amount]))

Hope this helps.

Ashish_Mathur_0-1733785641446.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur Thank you for your help.

Quick question, on the 2nd half of the ALLSELECTED() that looks at tblData[MPC] and tblData[Product Type].

 

If I were to remove this filter criteria from the measure, will it work with the Filter Pane (Filter Pane is where it's the same pane with 'Visualization" and 'Data" and/or slicer?

ALLSELECTED(tblData[MPC],tblData[Product Type])

 

You are welcome.  It should.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
AnkitaaMishra
Super User
Super User

Hi @JustDavid , Could you please elaborate what about your problem statement or share some sample output what you are referring to.

Ashish_Mathur
Super User
Super User

Hi,

I cannot understand your question.  Share some data to work with, explain the question and show the expected result. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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