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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
New to power bi, I need Power Bi to recalculate percentages based on the filters of a visualization.
I need to divide the Planned hours by actual hours to get an efficiency %, and then to be able to recalculate by whatever filter I choose i.e company, location, or week. Right now it is currently summing all planned hours and actual hours regardless of the filter.
data
an attempt at the formula:
Efficiency = CALCULATE(sum(table[planned hours)/sum(table[actual hours]),ALLSELECTED(table))
Solved! Go to Solution.
@Anonymous
You cannot divide in the calculate function, try separate the expression like the following:
Efficiency = CALCULATE(sum(table[planned hours),ALLSELECTED(table)) / CALCULATE(sum(table[actual hours]),ALLSELECTED(table))
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
You cannot divide in the calculate function, try separate the expression like the following:
Efficiency = CALCULATE(sum(table[planned hours),ALLSELECTED(table)) / CALCULATE(sum(table[actual hours]),ALLSELECTED(table))
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm not clear on why you are using ALLSELECTED. You are telling it to remove the filters from the table internally but keep filters from the outside. That means every row will be the same for whatever slicers/filters/crosshighlighting happens, but the filter context within the filter (company rows) is ignored. Just use this.
Effeciency =
DIVIDE(
SUM('Table'[Planned]),
SUM('Table'[Actual])
)
You would only want some sort of ALL/REMOVEFILTERS if you needed the denominator for example, to remain constant no matter what, and then you use it on the denominator only. You've effectively used it on both numerator and denominator.
If you need more help, please post some data we can use (links below) and your expected results. Screenshots from Excel are good for expected result mock ups, but not for providing data for us to use.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingVote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 6 | |
| 6 | |
| 5 |