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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Measure to sum a calculated column gives incorrect value

Hi Community,

I have a calculated column 'Wait time for Contact'. If I pull this column on a matrix (Page1 in pbi file), it gives correct values only if 'Average' of the column is selected that is:Capture3.PNG

I created a measure 'Wait time for Contact_Oct' to calculate the sum of the above mentioned column ('Wait time for Contact') for Oct 2020.

This measure doesn't give the correct value.

Just to test, if I pull the sum of 'Wait time for Contact' column on a table visual, then also the values for Oct 2020 is wrong.

Both visuals & Expected value is on Page3 in my following PBI file:

https://1drv.ms/u/s!Ag919_pO_UKrgQwdzaPqiwm7NcmX?e=RePjMg

 

Any help is much appreciated, thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for late reply. I did a test. Is that result you want?

Here is my test process.

v-yuaj-msft_0-1608544836979.png

I noticed that the "PATIENTCODE" field may be the breaking point of the problem. So I created a new table as shown below.

Table = ADDCOLUMNS(SUMMARIZE('Table1',Table1[PATIENTCODE]),"s",CALCULATE(AVERAGE('Table1'[Wait time for Contact]),ALLEXCEPT(Table1,Table1[PATIENTCODE])))
 

v-yuaj-msft_0-1608544990298.png

Then I create a measure.

Measure 3 = SUM('Table'[s])
 
Result:

v-yuaj-msft_1-1608545069732.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for late reply. I did a test. Is that result you want?

Here is my test process.

v-yuaj-msft_0-1608544836979.png

I noticed that the "PATIENTCODE" field may be the breaking point of the problem. So I created a new table as shown below.

Table = ADDCOLUMNS(SUMMARIZE('Table1',Table1[PATIENTCODE]),"s",CALCULATE(AVERAGE('Table1'[Wait time for Contact]),ALLEXCEPT(Table1,Table1[PATIENTCODE])))
 

v-yuaj-msft_0-1608544990298.png

Then I create a measure.

Measure 3 = SUM('Table'[s])
 
Result:

v-yuaj-msft_1-1608545069732.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Anonymous ,

 

Thanks for your reply. Is this the result you want? I tried the same approach, but it seems to get a different result from yours.

v-yuaj-msft_0-1607671575679.png

 

Best Regards,

Yuna

 

Anonymous
Not applicable

@Anonymous  Nope, please filter by column 'First contact '= Oct ,Not Date-month = Oct. 

I want to calculate sum of wait times where 'First Contact' = Oct. 'First contact' can be in Oct for date-month = Sep or Oct.

Also for this reason in the measure I have: USERELATIONSHIP(Table1[First contact],Datedim[Date]) which is an inactive relationship. 

Anonymous
Not applicable

@Anonymous  any update?

Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for that it's still not very clear. What I am confused is how to get 1736 for "wait time for contact_oct".

 

Could you please give me your calculation ideas?

v-yuaj-msft_0-1607669042188.png

 

Best Regards,

Yuna

 

Anonymous
Not applicable

@Anonymous  thanks for replying. 

Wait time for Contact_Oct =
CALCULATE(SUMX ( VALUES ( Table1[Wait time for Contact]), CALCULATE ( MAX (Table1[Wait time for Contact]) )),USERELATIONSHIP(Table1[First contact],Datedim[Date]),Table1[First contact]<>BLANK(),month(Table1[First contact])=month(today())-2,year(Table1[First contact])=year(today()))
I basically exported the matrixon Page1 to excel, filtered the data for 'first contact' month = Oct 2020. Then summed up the column 'Average of wait time for contact', that gives 1736. As I mentioned in my post that on the matrix I get the correct wait time for contact only by pulling it as Average.

 

Capture3.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors