Forum Discussion
Sum - Headcount
- 9 years ago
I assume you use "merge queries" with full join to create this table so that those "not match" rows will aggregate together.
In this scenario, I suggest you filter those "not match" rows in your table. You can filter empty rows in Query Editor.
If you don't want to modify the table, you can add filter expression in your calculation.
Headcount = CALCULATE( SUM(MonthlyStartersAndLeavers[Net]), FILTER ( ALL ( 'MonthlyStartersAndLeavers'[Months] ), 'MonthlyStartersAndLeavers'[Months]<>BLANK() ), FILTER(ALL(DateTable[DateKey]),DateTable[DateKey]<=MAX(DateTable[DateKey])) )
Alternatively I've calculated the headcount as a measure, using the below formula, but the -313 is still taken into account.
Headcount = CALCULATE(SUM(MonthlyStartersAndLeavers[Net]),FILTER(ALL(DateTable[DateKey]),DateTable[DateKey]<=MAX(DateTable[DateKey])))
- v-sihou-msft9 years agoMicrosoft Employee
I assume you use "merge queries" with full join to create this table so that those "not match" rows will aggregate together.
In this scenario, I suggest you filter those "not match" rows in your table. You can filter empty rows in Query Editor.
If you don't want to modify the table, you can add filter expression in your calculation.
Headcount = CALCULATE( SUM(MonthlyStartersAndLeavers[Net]), FILTER ( ALL ( 'MonthlyStartersAndLeavers'[Months] ), 'MonthlyStartersAndLeavers'[Months]<>BLANK() ), FILTER(ALL(DateTable[DateKey]),DateTable[DateKey]<=MAX(DateTable[DateKey])) )- Spencer9 years agoHelper II
That'll be ideal, huge thanks v-sihou-msft