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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX measure to display MAX and MIN of summed values depending on selected categories

Hello,

 

I am struggling for a few days with this issue. I have a table with 4 columns - SiteID, BrandID, Productgroup and Value. SiteID and ProductGroup are used as a slicer in the report and the visual is a table that shows BrandID and Sum(Value). I need 2 measures that would display the maximum and minimum of the Sum(Value)  depending on the selection of the 2 slicers (taking in consideration also multiple selections on the slicers).

I've tried to create this measure, but the output is the maximum raw value (not summed):

SumValue = Sum(Value)
 
BrandMaxSelectedValue =
              MAXX(
                     FILTER(
                          SELECTCOLUMNS(
                                     ALLSELECTED('Table1'),
                                       "id", [SumValue],
                                       "max", MAXX(ALLSELECTED('Table1'), [SumValue])
                                            ),
                                    [id] = MAXX(ALLSELECTED('Table1'),[SumValue])
                            ),
                          [max]
           ).
 
Any help would be appreciated.
 
Thanks,
 
Narcis
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have figured it out. It was a simple update to the measure I was using. Can't believe I didn't try it until now :

 

BrandMaxSelectedValue =
         MAXX(
               FILTER(
                    SELECTCOLUMNS(
                            ALLSELECTED('Table1'[BrandID]),
                           "id", [SumValue],
                           "max", MAXX(ALLSELECTED('Table1'[BrandID]), [SumValue])
                                        ),
                    [id] = MAXX(ALLSELECTED('Table1'[BrandUID]),[SumValue])
                    ),
              [max]
)

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

Hi @Anonymous 

It is not completely clear. Can you show an example based on data with the expected result, so as to further clarify what you need?

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

 

SU18_powerbi_badge

Anonymous
Not applicable

 

 

untitled.png

 

The table in the right is the raw table, SiteID and BrandID are not distinct values, each appear multiple times in the dataset.

The table in the left is the the visual where I need to display the Max and Min values. The Max value of the selected brands should be 4115, but instead my formula returns 1976.38.

 

Thank you,

Narcis

Anonymous
Not applicable

I have figured it out. It was a simple update to the measure I was using. Can't believe I didn't try it until now :

 

BrandMaxSelectedValue =
         MAXX(
               FILTER(
                    SELECTCOLUMNS(
                            ALLSELECTED('Table1'[BrandID]),
                           "id", [SumValue],
                           "max", MAXX(ALLSELECTED('Table1'[BrandID]), [SumValue])
                                        ),
                    [id] = MAXX(ALLSELECTED('Table1'[BrandUID]),[SumValue])
                    ),
              [max]
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.