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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Daveyt69
Regular Visitor

Max and Min of TopN formula

Hello 

 

I am extemely new to Power BI and as such I'm having some problems with DAX.  I have found a formula that currently works for me using various slicers and these include a site name, user name, category, result  and date and time.  I also have found away to limit the figures I need with a TopN slicer.  The formula I am using to sum various fields is as follows:

 

CLEARANCE OBSTRUCT TOTAL = sumx(TOPN('TopN'[TopN Value], 'VW_TEST_EVENT', 'VW_TEST_EVENT'[All Data Field],DESC), 'VW_TEST_EVENT'[CLEARANCE_OBSTRUCT_TOTAL])
 
The problem I now have is I need the Max and Min of these formula but cannot find a way to do this.
 
Is there a simple way to get the Max and Min of the above formula or do I need to start again ?
 
Thanks in advance.
David 
3 REPLIES 3
johnt75
Super User
Super User

If you're looking for the max & min of 'VW_TEST_EVENT'[CLEARANCE_OBSTRUCT_TOTAL] when filtered to the TopN then you can use exactly the same formula you have replacing SUMX with MINX and MAXX

Hi Johnt75 
Thanks for getting back to me.
I did try that and what it seems to be doing is showing the max for that particular column and not the max of the combined users.
I've been using the following the following equation:

c MAX = (MAXX(
KEEPFILTERS(ALL('VW_TEST_EVENT'[User])),
CALCULATE((sumx(TOPN('TopN'[TopN Value], 'VW_TEST_EVENT', 'VW_TEST_EVENT'[All Data Field],DESC), 'VW_TEST_EVENT'[CLEARANCE OBSTRUCT TOTAL]))
)))
however it does not seem to take into account any changes to the slicers I am using e.g. a date/time slicer.

I don't think I understand what you are trying to calculate

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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