Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi everyone,
I have 3 separate DAX measures. They all work fine in its current state, but want to clean it up. The second measure relies on the first meaure, then the 3rd measure relies on the 2nd measure, just like a hierarchy.
For the life of me, I am trying to combine them into one measure. I am having trouble with structuring them within one measure. Can someone please help me?
Here are my 3 measures which all work perfectly in its current state:
First Measure: --Sum total effort in hours
Project Effort Estimate (Hrs) = sum(Effort_Estimate[HoursEffortPerDay])
Second Measure: --Convert Sum of total Hours to FTE
Project Effort Estimate (FTE) =
VAR NumberofDaysInDate = CALCULATE ( COUNTROWS ( FILTER ( Dim_Date, Dim_Date[IsWorkDay] = TRUE() )))
VAR FullTimeFTE =
CALCULATE (
[Project Effort Estimate (Hrs)],
FILTER (Effort_Estimate, Effort_Estimate[employmentType] = "FullTime" )
) / NumberofDaysInDate / 7.5
VAR ContractorFTE =
CALCULATE (
[Project Effort Estimate (Hrs)],
FILTER (Effort_Estimate, Effort_Estimate[employmentType] = "Contractor" )
) / NumberofDaysInDate / 8
RETURN
FullTimeFTE + ContractorFTE
Measure 3: --Summarize the FTE totals
SUMX(
SUMMARIZE(
'Effort_Estimate',
Effort_Estimate[ID],
"TotalFTE", [Project Effort Estimate FTE Total]
),
[TotalFTE]
)
Solved! Go to Solution.
Meas =
SUMX (
SUMMARIZE (
'Effort_Estimate',
Effort_Estimate[ID],
"TotalFTE",
VAR NumberofDaysInDate =
CALCULATE ( COUNTROWS ( FILTER ( Dim_Date, Dim_Date[IsWorkDay] = TRUE () ) ) )
VAR FullTimeFTE =
CALCULATE (
SUM ( Effort_Estimate[HoursEffortPerDay] ),
FILTER ( Effort_Estimate, Effort_Estimate[employmentType] = "FullTime" )
) / NumberofDaysInDate / 7.5
VAR ContractorFTE =
CALCULATE (
SUM ( Effort_Estimate[HoursEffortPerDay] ),
FILTER ( Effort_Estimate, Effort_Estimate[employmentType] = "Contractor" )
) / NumberofDaysInDate / 8
RETURN
FullTimeFTE + ContractorFTE
),
[TotalFTE]
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi @Deevo_
To clean it up and combine everything into a single final measure, you just need to inline the intermediate calculations inside your final SUMX measure.The final combined measure is given below:-
Total FTE =
SUMX (
'Project Effort Estimate',
VAR NumberOfDays =
CALCULATE (
COUNTROWS ( FILTER ( Dim_Date, Dim_Date[IsWorkDay] = TRUE () ) )
)
VAR FullTimeFTE =
CALCULATE (
'Project Effort Estimate'[ProjEffortHrs] * 'Project Effort Estimate'[HoursEffortPerDay],
'Project Effort Estimate'[EmploymentType] = "FullTime"
) / NumberOfDays / 7.5
VAR ContractorFTE =
CALCULATE (
'Project Effort Estimate'[ProjEffortHrs] * 'Project Effort Estimate'[HoursEffortPerDay],
'Project Effort Estimate'[EmploymentType] = "Contractor"
) / NumberOfDays / 8
RETURN
FullTimeFTE + ContractorFTE
)
I appreciate your response Can you please help me to understand what these two measures are doing and what they mean?
'Project Effort Estimate'[ProjEffortHrs] * 'Project Effort Estimate'[HoursEffortPerDay],
Meas =
SUMX (
SUMMARIZE (
'Effort_Estimate',
Effort_Estimate[ID],
"TotalFTE",
VAR NumberofDaysInDate =
CALCULATE ( COUNTROWS ( FILTER ( Dim_Date, Dim_Date[IsWorkDay] = TRUE () ) ) )
VAR FullTimeFTE =
CALCULATE (
SUM ( Effort_Estimate[HoursEffortPerDay] ),
FILTER ( Effort_Estimate, Effort_Estimate[employmentType] = "FullTime" )
) / NumberofDaysInDate / 7.5
VAR ContractorFTE =
CALCULATE (
SUM ( Effort_Estimate[HoursEffortPerDay] ),
FILTER ( Effort_Estimate, Effort_Estimate[employmentType] = "Contractor" )
) / NumberofDaysInDate / 8
RETURN
FullTimeFTE + ContractorFTE
),
[TotalFTE]
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
@FBergamaschi Thank you so much. This structure is exactly what I was after. It works exactly as it should too. Easy to understand. Perfect!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |