Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, how to write a dax formula to sum up all values from the column value based on the following conditions?
First condition is that we need to group by ID1
Second condition is that we only sum values from the max value of ID2
ID1 | ID2 | Value |
12 | 5543 | 100 |
31 | 4125 | 150 |
31 | 6412 | 50 |
31 | 1333 | 300 |
In this case the sum should return 100+50=150.
Solved! Go to Solution.
Try this measure:
Sum of Max Value =
VAR vBaseTable =
ADDCOLUMNS (
VALUES ( 'Table'[ID1] ),
"@MaxID2", CALCULATE ( MAX ( 'Table'[ID2] ) )
)
VAR vFilterTable =
TREATAS ( vBaseTable, 'Table'[ID1], 'Table'[ID2] )
VAR vResult =
CALCULATE ( SUM ( 'Table'[Value] ), vFilterTable )
RETURN
vResult
Proud to be a Super User!
Try this measure:
Sum of Max Value =
VAR vBaseTable =
ADDCOLUMNS (
VALUES ( 'Table'[ID1] ),
"@MaxID2", CALCULATE ( MAX ( 'Table'[ID2] ) )
)
VAR vFilterTable =
TREATAS ( vBaseTable, 'Table'[ID1], 'Table'[ID2] )
VAR vResult =
CALCULATE ( SUM ( 'Table'[Value] ), vFilterTable )
RETURN
vResult
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |