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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi there,
I'm not having much luck working out how to do a certain calculation.
I'm applying a filter to my visual (Outcome Group as one of 'Charged/Summonsed', 'Diversionary, educational or intervention activity...', 'Out-of-court (informal)', 'Out-of-court (formal)') and for each category (Force Name) attemping to calculate percentage change in Outcomes for offences that were recorded in the quarter between each End date in my data and a starting End date - 2014-06-30.
My workbook is available here: https://www.dropbox.com/scl/fi/vr16i5qxbdxq8jx6iuk5l/Police-outcomes-open-data-testing.pbix?rlkey=pb...
And the data here: https://www.dropbox.com/scl/fi/0godipehi6tlriklks2lb/Working-file-police-outcomes-open-data.xlsx?rlk...
This is the DAX query I've written:
Outcomes for investigations closed in the quarter QoQ% =
VAR _start_value =
CALCULATE(
SUM('Collated data'[Outcomes for investigations closed in the quarter]),
KEEPFILTERS('Collated data'[End date]=DATE(2014,6,30))
)
RETURN
DIVIDE(
SUM('Collated data'[Outcomes for investigations closed in the quarter])
- _start_value,
_start_value
)
Solved! Go to Solution.
Thanks for the reply from @some_bih , please allow me to provide another insight.
Hi @philipnye ,
You just need to change this line in the measure by removing KEEPFILTERS.
When _start_value is calculated, the internal filter provided by /'Collated data'[End date]=DATE(2014,6,30)/ will override the filter provided by the matrix End date column.
KEEPFILTERS('Collated data'[End date]=DATE(2014,6,30))
The modified measure.
Outcomes for investigations closed in the quarter QoQ% =
VAR _start_value =
CALCULATE(
SUM('Collated data'[Outcomes for investigations closed in the quarter]),
'Collated data'[End date]=DATE(2014,6,30)
)
RETURN
DIVIDE(
SUM('Collated data'[Outcomes for investigations closed in the quarter])
- _start_value,
_start_value
)
The measure works correctly on subsequent dates.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous, @some_bih
@Anonymous Thank you so much - that solves my problem! Hero ✨
@some_bih Thank you - and sorry my data wasn't available (I posted the wrong version initially and think you must have looked in the window between me taking the old data down and adding a replacement dataset). Thanks for your willingness to help though!
Thanks for the reply from @some_bih , please allow me to provide another insight.
Hi @philipnye ,
You just need to change this line in the measure by removing KEEPFILTERS.
When _start_value is calculated, the internal filter provided by /'Collated data'[End date]=DATE(2014,6,30)/ will override the filter provided by the matrix End date column.
KEEPFILTERS('Collated data'[End date]=DATE(2014,6,30))
The modified measure.
Outcomes for investigations closed in the quarter QoQ% =
VAR _start_value =
CALCULATE(
SUM('Collated data'[Outcomes for investigations closed in the quarter]),
'Collated data'[End date]=DATE(2014,6,30)
)
RETURN
DIVIDE(
SUM('Collated data'[Outcomes for investigations closed in the quarter])
- _start_value,
_start_value
)
The measure works correctly on subsequent dates.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @philipnye I could not see your data .I hope you have Calendar / Date table created in Power BI.
Check link for creating it.
If you have your measure should leverage Date table your and your fact table, without part DATE(2014,6,30) in your CALCULATE part.
Proud to be a Super User!