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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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