Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi
I am trying to calculte energy usage using filtered values from the same column.
this is the calcultion I am trying to resolve.
I get the error below.
A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Bondi Use = CALCULATE(
SUM(Energy[Value]),Filter(Energy,Energy[Meter]="CB0NCGN01N (MWh)")+
SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00017 (MWh)")+
SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-EXP (MWh)") -
SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-IMP (MWh)")
)
Solved! Go to Solution.
Hi,
I managed to get the correct result using variables. I am not sure if this is the most efficient way to do this.
Bondi Use =
VAR A = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="CB0NCGN01N (MWh)"))
VAR B = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00017 (MWh)"))
VAR C = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-EXP (MWh)"))
VAR D = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-IMP (MWh)"))
Return
CALCULATE(A+B+C-D)
Hi,
I managed to get the correct result using variables. I am not sure if this is the most efficient way to do this.
Bondi Use =
VAR A = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="CB0NCGN01N (MWh)"))
VAR B = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00017 (MWh)"))
VAR C = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-EXP (MWh)"))
VAR D = CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-IMP (MWh)"))
Return
CALCULATE(A+B+C-D)
Hi,
Try this measure
=CALCULATE(SUM(Energy[Value]),Filter(Energy,Energy[Meter]="NCCCX00018-IMP (MWh)"||Energy[Meter]="NCCCX00018-EXP (MWh)"||Energy[Meter]="NCCCX00017 (MWh)"||Energy[Meter]="CB0NCGN01N (MWh)"))
Hope this helps.
Hi Thanks for you help but the solutions only allow you to perform one function like SUM() or COUNT() for all of the filter results. I need to do something different with each filtered value like sum, divide, subtract, multiply. A + B + C x D
Hi @zenton,
If so, I'm afraid your solution could be the only choice. Maybe the plus parts (+) could be optimized. You can sum them together.
Best Regards,
Dale
Hi @zenton,
Try these two formulas below please. You can use either of them according to your requirement.
Bondi Use =
CALCULATE (
SUM ( Energy[Value] ),
Energy[Meter]
IN {
"CB0NCGN01N (MWh)",
"NCCCX00017 (MWh)",
"NCCCX00018-EXP (MWh)",
"NCCCX00018-IMP (MWh)" }
)
Bondi Use =
CALCULATE (
SUM ( Energy[Value] ),
FILTER (
Energy,
Energy[Meter]
IN {
"CB0NCGN01N (MWh)",
"NCCCX00017 (MWh)",
"NCCCX00018-EXP (MWh)",
"NCCCX00018-IMP (MWh)" }
)
)
Best Regards,
Dale
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 37 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 37 | |
| 28 | |
| 27 |