Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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[Program]= "Program1" && DataTable[Mode] = "Internal" )
)
But i cannot work out the correct syntax to add the filter statement above into the measure below:
The measure currently returns costs for the previous year for all programs but I would like to apply the criteria shown to select the previous years costs for Program1 only.
Total Costs Program1 (For Previous Year) =
CALCULATE(SUM(DataTable[Cost]),DATESYTD(ENDOFYEAR(DATEADD('Calendar'[Date],-1,YEAR)),"12,31"))
I'm assuming the
FILTER ( ALL ( DataTable ), DataTable[Program]= "Program1" && DataTable[Mode] = "Internal" )
should be incorporated into the immediately after the SUM( in the 'Total Costs Program1 (For Previous Year)' measure but am struggling to get the correct syntax.
Thanks,
Richard
Solved! Go to Solution.
@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-TIT...
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])
)
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 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-TIT...
Thanks for the assistance @Greg_Deckler . Thats Time Intelligence you provided were very helpful.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 63 | |
| 45 | |
| 41 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 192 | |
| 125 | |
| 106 | |
| 78 | |
| 53 |