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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jo5hua22
Helper I
Helper I

Max value based on filter

Hi Users

 

Can you please help me with finding the maximum value based on filters?

 

Steps to be done:

1. Filter Measurement Type as Trial 1.

2. Filter Machine as 1011

3. In the quantity, you can see 3 rows as 5,8,1. This means that there are 8 measurements to be done but on 2 rows, only 5 & 1 measurement were done. 

4. So, I need to determine the maxiumum value based on the mentioned filter. Can you please help me with this?

 

 

Please find the sample picture of the dataset below.

Jo5hua22_0-1645181848891.png

@amitchandak@ValtteriN  : Can you please help me out?

1 ACCEPTED SOLUTION

Hi all

Thanks for your comments. I managed to find a solution for my problem

In a measure variable,

#Meas =
CALCULATE(
MAXX(
SUMMARIZE(Table1,Table1[Measurement Type],Table1[Machine],"Count",COUNT(Table1[Qty]))
,[Count]
),ALLEXCEPT(Table1,Table1[Measurement Type],Table1[Machine]))

View solution in original post

7 REPLIES 7
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I think you can achieve this using the slicers in the Power BI and the visual TOPN filter:

 

You can create two slicers to place the field [Measurement Type] and [Machine] and a table chart to place the columns within the table, then you can set the visual filter as “TOPN” for the table chart like this:

vrobertqmsft_0-1645513627503.png

 

And you can get what you want.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

Jo5hua22
Helper I
Helper I

Hi @Russell-PBI 

I need to apply filters as mentioned in the steps. Max(QTY) just shows the maximum value in the table

@Jo5hua22 

Hi,

I think @Russell-PBI 's new solution should solve your issue. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Do you mean you want a measure that itself is filtered, like this?:

Max Qty - 1011 and Trial 1 = 
CALCULATE(
MAX('Table'[Qty])
, 'Table'[Machine] = 1011
, 'Table'[Measurement Type] = "Trial 1"
)
Russell-PBI
Resolver II
Resolver II

Hi @Jo5hua22, are we missing a piece of the puzzle as it looks like you could just use MAX aggregation on the Qty column?:

RussellPBI_0-1645192427306.png

MAX(Qty)

 

Hi all

Thanks for your comments. I managed to find a solution for my problem

In a measure variable,

#Meas =
CALCULATE(
MAXX(
SUMMARIZE(Table1,Table1[Measurement Type],Table1[Machine],"Count",COUNT(Table1[Qty]))
,[Count]
),ALLEXCEPT(Table1,Table1[Measurement Type],Table1[Machine]))

@Russell-PBI Actually many pieces were missing but @Jo5hua22 clearified all to me before he eventually found the solution by himself. I think there is another post by him of the same. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors