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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.