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
PBI5851
Helper V
Helper V

How to calculate sum of a measure

Hello, 

I have the below raw data 

PersonIDTravelDateContactCount
John11/1/20235
John11/2/20236
John11/3/20233
Nick11/1/20234
Nick11/2/20237
Steve11/3/20235
Mary11/2/20233

 

 

For each person, there is a goal and the way i did it is to create two measures. 

1)maxperson = max(MainTable[PersonID])

and then 

2) persongoal = IF(MainTable[maxperson] ="Mary",8,10)

 

At the end i display the goal filled %. Now, i expect to have the result as 

PersonIDContactCountGoalGoalFilled
John1410140%
Nick1110110%
Steve51050%
Mary3838%
Total333887%

 

But i get the result as below.

PersonIDContactCountGoalGoalFilled
John1410140%
Nick1110110%
Steve51050%
Mary3838%
Total3310330%

 

The columns work, but the total gets messed up. Any recommendation on how to fix the total . 

PBI5851_0-1700503547457.png

Thank you.

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

It's a measure totals issue.

Try

SUMX(VALUES(MainTable[PersonID]),IF ([maxperson] ="Mary", 8,10))

 

--

As a convention when we use a measure in another measure, we don't precede it with the table name

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

It's a measure totals issue.

Try

SUMX(VALUES(MainTable[PersonID]),IF ([maxperson] ="Mary", 8,10))

 

--

As a convention when we use a measure in another measure, we don't precede it with the table name

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.