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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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