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
naninamu
Helper IV
Helper IV

Filtering a table for Max and Min

Hi - I think this should be simple but for some reason won't work for me! 

 

I have a table that look like this. It lists a Folder, the type of file in it and the score for each file. This is an example of one folder called "Students"

FolderTypeScore
StudentsBank account8
StudentsPassport9
StudentsDriver License9
StudentsMedical Account9
StudentsCC Number8
StudentsTax Number9

 

Ultimately, I want to work out the Max and Min score for each folder. In this simplified example there are only a few rows, in real life it could be hundreds.

 

So I thought I could just remove the Type column to get this:

FolderScore
Students8
Students9

 

And then apply the Min and Max on the Score within the visualisation.

 

It works for Max as 9 is the greatest possible value in the set. For Min though I'm getting

 

FolderScore
Students7

 

Which I think is because for other folders other than Students the value can be anything from 7 to 9. 7 isn't a value that appears in the Student folder, but it's reporting it as the Min.

 

How do I get it to report 8 as the Min?

 

Gussing it's not as simple as I was hoping...

Thanks in advance!

1 ACCEPTED SOLUTION

Just to show that without Dax you see a different result...filtered also by type.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
naninamu
Helper IV
Helper IV

Sorry @Ritaf1983  - just had a closer look. What is the max of score column representing?

naninamu_0-1739334665130.png

 

Just to show that without Dax you see a different result...filtered also by type.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
naninamu
Helper IV
Helper IV

That's awesome - I will give this a go later tonight. Thanks!

Ritaf1983
Super User
Super User

Hi @naninamu 

If you want to display the minimum and maximum scores when your visualization only includes the Folder field, you can simply use the Score column twice—once with the Min aggregation and once with the Max aggregation, like in the example below.

Ritaf1983_0-1739333633023.png

 

 

 

 

 

However, if you need to use these measures alongside other dimensions or within another measure, you need to adjust the filter context. You can do this using the ALLEXCEPT function, ensuring that the Min and Max calculations remain specific to each Folder.

Here’s how you can define the measures:

Folder_min = CALCULATE(min('Table'[Score]),ALLEXCEPT('Table','Table'[Folder]))
Folder_Max = CALCULATE(max('Table'[Score]),ALLEXCEPT('Table','Table'[Folder]))
Ritaf1983_1-1739333756750.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
naninamu
Helper IV
Helper IV

Thanks - my model is a bit more complex but is Star Schema. I might have to play around with the DAX functions a bit, don't think I'll be able to just do it from within the visualisation. 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

If the data model descrbes STAR SCHEMA, something like below, I think it can be approached by using simple MIN and MAX DAX functions.
Please check the below picture and the attached pbix file.

Jihwan_Kim_1-1739333049966.png

 

 

Jihwan_Kim_0-1739333036103.png

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.