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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.