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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jonassantos
Regular Visitor

group and display values ​​from a measure

I'm trying to sum the values ​​of a column generated from a measure.
the totalBycodeAlpha column is the measure that I'm trying to create, in it I'm trying to sum the values ​​of the value_calculated column (measure), grouped by the code-alpha column and display these values. But it turns out it's a lot harder than I thought...

does anyone know a way to solve this

link of project:
https://drive.google.com/file/d/14yUk7y-UfOY0f21ySWCqsGuctdVJMARM/view?usp=sharing

how i am trying to apply:

totalBycodeAlpha =
//total must sum the measure (value_calculated)  by code_alphA
CALCULATE(
    SUMX('base calculate',[maxValueOfProducts]),
    ALLSELECTED('base calculate'),
    FILTER('base calculate',
    'base calculate'[code-alpha]=MAX('base calculate'[code-alpha]))
)
 
 

 

 

table with dataset

 

jonassantos_0-1676819875678.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jonassantos , You need something like

 

CALCULATE(
SUMX('base calculate',[maxValueOfProducts]),
FILTER(ALLSELECTED('base calculate'),
'base calculate'[code-alpha]=MAX('base calculate'[code-alpha]))
)

 

 

or refer

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
jonassantos
Regular Visitor

thanks, realy very good the result.

amitchandak
Super User
Super User

@jonassantos , You need something like

 

CALCULATE(
SUMX('base calculate',[maxValueOfProducts]),
FILTER(ALLSELECTED('base calculate'),
'base calculate'[code-alpha]=MAX('base calculate'[code-alpha]))
)

 

 

or refer

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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