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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Steels_Cat
Helper I
Helper I

Count the highest value in table

Hello, I’m looking for a solution to find the highest value for each cycle and then sum them up after identifying the highest numbers. This is an example of what I’m looking for. I`m not sure how to create "Measure" column 

Steels_Cat_1-1732544643138.png

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Steels_Cat 

 

Thank you very much mh2587 for your prompt reply.

 

Pls try this:

 

Create measures.

 

First query the maximum value in each group [Project], marked as 1.

 

 

MaxValues = 
IF(
    SELECTEDVALUE('Table'[Value]) = 
    CALCULATE(
        MAX('Table'[Value]),
        FILTER(
            ALL('Table'),
            'Table'[Project] = MAX('Table'[Project])
        )
    ),
    1,
    BLANK()
)

 

 

vnuocmsft_0-1732589516142.png

 

Counts the values that are 1 in each group [Cycle].

 

 

Count Cycle = 
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[Cycle] = MAX('Table'[Cycle])
        &&
        'Table'[MaxValues] = 1
    )
)

 

 

Here is the result.

 

vnuocmsft_1-1732589569275.png

 

Regards,

Nono Chen

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

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1732592416161.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1732592416161.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Steels_Cat 

 

Thank you very much mh2587 for your prompt reply.

 

Pls try this:

 

Create measures.

 

First query the maximum value in each group [Project], marked as 1.

 

 

MaxValues = 
IF(
    SELECTEDVALUE('Table'[Value]) = 
    CALCULATE(
        MAX('Table'[Value]),
        FILTER(
            ALL('Table'),
            'Table'[Project] = MAX('Table'[Project])
        )
    ),
    1,
    BLANK()
)

 

 

vnuocmsft_0-1732589516142.png

 

Counts the values that are 1 in each group [Cycle].

 

 

Count Cycle = 
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[Cycle] = MAX('Table'[Cycle])
        &&
        'Table'[MaxValues] = 1
    )
)

 

 

Here is the result.

 

vnuocmsft_1-1732589569275.png

 

Regards,

Nono Chen

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

 

This it works but I need to use insted of 'Table'[Value], I need to use a measure which is Sumx('Table, Table[Value]). Is it possible to do that, beocuse in current logic does not work proparly 

Steels_Cat
Helper I
Helper I

This is what I got as result. Only it looks for Values in and highlighted them as 1

IN {"Cycle 1","Cycle 2", "Cycle 3"},

Steels_Cat_0-1732548385627.png

 

mh2587
Super User
Super User

Measure Sum = //Try this
SUMX(
    SUMMARIZE(
        Data, 
        Data[Cycle],
        "MaxValue", MAX(Data[Value])
    ),
    IF(
        Data[Cycle] IN {"Cycle 1","Cycle 2", "Cycle 3"},
        1,
        0
    )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.