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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mazsheps
New Member

Filter or grouping help

Hello,

 

I am trying to filter with conditions and I'm struggling to work out how to manage.  I have names A and B, Dates and a status ranked Final>Interim>Preliminary, so I just want to keep the highest ranked status for each name and date.  There are also a lot of other columns to the right.  I have tried adding a column to give the status a value and then grouping the values, but I can only get name and date and a custom column with number related to the status.  This does give the correct result but I also need all the other columns to be visible.

 

NameProd DateStatusLots more columns
A1/1/17Final 
A1/1/17Preliminary 
B1/1/17Final 
B1/1/17Preliminary 
A2/1/17Final 
A2/1/17Preliminary 
B2/1/17Final 
B2/1/17Preliminary 
A3/1/17Preliminary 
B3/1/17Preliminary 

 

to give 

 

NameProd DateStatusLots more columns
A1/1/17Final 
B1/1/17Final 
A2/1/17Final 
B2/1/17Final 
A3/1/17Preliminary 
B3/1/17Preliminary 

 

Any help would be hugely appreciated.

1 ACCEPTED SOLUTION

I have found a solution using https://excelgorilla.com/power-bi/power-query/reach-underlying-rows-using-table-max/

@v-lili6-msft works for visuals, but I was wating all the sorting done in power query editor.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @mazsheps 

For your case, you could try this simple way as below:

Step1:

Create a measure as below:

highest status = 
IF (
    MIN ( 'Table'[Status] )
        = CALCULATE (
            MIN ( 'Table'[Status] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Name] = MAX ( 'Table'[Name] )
                    && 'Table'[Prod Date] = MAX ( 'Table'[Prod Date] )
            )
        ),
    MIN ( 'Table'[Status] )
)

Step2:

Then you could use one of these two way to show the expected output.

1. Drag all the fields you want to show and this measure except [Status] field in a table visual.

2.JPG

2. Drag all the fields you want to show and [Status] field in a table visual, then drag this measure into table visual level filter and set filter is not blank

3.JPG

 

 

here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have found a solution using https://excelgorilla.com/power-bi/power-query/reach-underlying-rows-using-table-max/

@v-lili6-msft works for visuals, but I was wating all the sorting done in power query editor.

amitchandak
Super User
Super User

Take a min of status. in Any visual, that should to along with the first two columns.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors