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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.