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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.