Forum Discussion
RichardJ
5 years agoResponsive Resident
Need help with syntax - adding a filter when calculating a sum please
Hi, This measure works as intended - it shows all costs for a specific program : Total Costs Program1 =
CALCULATE (
SUM(DataTable[Cost])+0,
FILTER ( ALL ( DataTable ), DataTable[Prog...
- 5 years ago
RichardJ You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008 - 5 years ago
Turned out the solution was pretty simple in the end.
Total Costs Program1 = CALCULATE ( SUM(DataTable[Cost])+0, FILTER ( ALL ( DataTable ), DataTable[Program]= "Program1" && DataTable[Mode] = "Internal" ), PREVIOUSYEAR('Calendar'[Date]) )
RichardJ
5 years agoResponsive Resident
Turned out the solution was pretty simple in the end.
Total Costs Program1 =
CALCULATE (
SUM(DataTable[Cost])+0,
FILTER ( ALL ( DataTable ), DataTable[Program]= "Program1" && DataTable[Mode] = "Internal" ),
PREVIOUSYEAR('Calendar'[Date])
)