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

Need to calculate Max for each ID and summarize at ID level

Hi,

Need help in find max for each ID and summarize it:

Sriku_0-1622030184274.png

 

Regards,

Sriku

 

1 ACCEPTED SOLUTION

Hi @Sriku ,

You can create a measure as below, please find the attachment for the details.

 

Max of Sales = 
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[ID],
        "maxSales",
            CALCULATE (
                MAX ( 'Table'[Sales] ),
                FILTER (
                    'Table',
                    'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] )
                        && 'Table'[Profit] = 1
                )
            )
    )
RETURN
    SUMX ( _tab, [maxSales] )

 

yingyinr_1-1622184532226.png

In addition, there are some good resources can help you learn DAX.

Good Source to Learn DAX

Use DAX in Power BI Desktop

How to learn DAX

DAX Guide

Best Regards

Community Support Team _ Rena
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

5 REPLIES 5
mahoneypat
Employee
Employee

Did you try just MAX(Table[Sales]) ?  That should work in this scenario, even with the Profit column slicer.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat, I am new and learning DAX, Can you please help in this

amitchandak
Super User
Super User

@Sriku ,

Create a measure

sumx(values(Table[ID]),Calculate( Max(Table[Sales])))

 

plot with ID in visual

Thanks for prompt response: If there a profit column need to filter by 1 and find max 

 

Sriku_0-1622031408247.png

Please help this

Hi @Sriku ,

You can create a measure as below, please find the attachment for the details.

 

Max of Sales = 
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[ID],
        "maxSales",
            CALCULATE (
                MAX ( 'Table'[Sales] ),
                FILTER (
                    'Table',
                    'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] )
                        && 'Table'[Profit] = 1
                )
            )
    )
RETURN
    SUMX ( _tab, [maxSales] )

 

yingyinr_1-1622184532226.png

In addition, there are some good resources can help you learn DAX.

Good Source to Learn DAX

Use DAX in Power BI Desktop

How to learn DAX

DAX Guide

Best Regards

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

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.