Forum Discussion
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.
amitchandak, ValtteriN : Can you please help me out?
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]))
7 Replies
- Russell-PBIResolver 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?:
MAX(Qty)
- tamerj1Community Champion
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.
- Jo5hua22Helper I
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]))
- Jo5hua22Helper I
Hi Russell-PBI
I need to apply filters as mentioned in the steps. Max(QTY) just shows the maximum value in the table
- ValtteriNCommunity Champion
Jo5hua22
Hi,
I think Russell-PBI 's new solution should solve your issue. - Russell-PBIResolver II
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"
)
- v-robertq-msftCommunity 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:
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.