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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lsullivan6311
Helper III
Helper III

Sum a Max of customer sales (Monthly Max by year) summed by a region

Here is an example of the data:

Midwest Region  YTD 2022 Max = 4500 + 500 = 5,000

Customer         Region         Year        Month          SalesVol

       A               Midwest       2021           1                   400

       A               Midwest       2021           2                  1500

       A               Midwest       2021           3                  4500

       B               Midwest       2021           1                    150

       B               Midwest       2021           2                   500

       B               Midwest       2021           3                    30

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @lsullivan6311,

It seems like a common multiple aggregation requirement. For this scenario, you can check the below measure formula if it helps: (my expression use summarize function to group records by Customer, Region, Year, Month fields and use the iterator function sumx to apply the second level aggregate)

formula =
SUMX (
    SUMMARIZE (
        Table,
        [Customer],
        [Region],
        [Year],
        [Month],
        "MaxSales", MAX ( Table[SalesVol] )
    ),
    [MaxSales]
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @lsullivan6311,

It seems like a common multiple aggregation requirement. For this scenario, you can check the below measure formula if it helps: (my expression use summarize function to group records by Customer, Region, Year, Month fields and use the iterator function sumx to apply the second level aggregate)

formula =
SUMX (
    SUMMARIZE (
        Table,
        [Customer],
        [Region],
        [Year],
        [Month],
        "MaxSales", MAX ( Table[SalesVol] )
    ),
    [MaxSales]
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

This does not sum the max sales values; it still just gives me the Max Customer sales volume withing that Region.  I get the same number using this calculation:  

 SalesMax = MAXX (Table, [SalesVol])

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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