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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GlynMThomas
Resolver I
Resolver I

Total Incorrect When Using Multiple Columns

Hi,

 

I have this model setup.

 

GlynMThomas_0-1663949296243.png

 

I have this measure:

 

Admin Estimate Days =
(SUM('WorkTimeData'[Days]) - SUM('Holidays'[Holiday Duration (Days)]) - SUM(Absence[Sick Duration (Days)])) * SUM('Name mapping'[Admin pc])
 
Because the Admin PC column is a fraction this means the total is incorrect in my table:
 
GlynMThomas_1-1663949451925.png

 

I would normally use a column to do this calc and then it would automatically do that calculation first then sum the values up like I want it to. But power bi won't allow me to pull the other columns into one place using RELATED unless it's in a measure which means the calc happens after the aggregation giving me an incorrect total.

 

How would I perform the caculation first before the aggregation?

1 ACCEPTED SOLUTION

Thanks, that kind of worked but introduced some other issues in the aggregation. I managed to solve it in the end with a summarised table combining all the values and aggregating them into 1 row.

View solution in original post

2 REPLIES 2
jgeddes
Super User
Super User

Try this calculated column in the Name mapping table

Calculated Column =
var _holidayDays =
CALCULATE(
    SUM(Holidays[Holiday Duration (Days)]),
    FILTER(Holidays, Holidays[Holiday PeopleHR Name] = Name mapping[PeopleHR Name])
)
var _absenceDays =
CALCULATE(
    SUM(Absence[Sick Duration (Days)]),
    FILTER(Absence, Absence[Absence PeopleHR Name] = Name mapping[PeopleHR Name])
)
var _workDays =
CALCULATE(
    SUM(WorkTimeData[Days]),
    FILTER(WorkTimeData, WorkTimeData[Name] = Name mapping[PeopleHR Name])
)
return
( _workDays - _holidayDays - _absenceDays) * nameTable[admin pc]




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks, that kind of worked but introduced some other issues in the aggregation. I managed to solve it in the end with a summarised table combining all the values and aggregating them into 1 row.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.