Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hcr4
Frequent Visitor

How to use filters from different tables in CALCULATE?

I have an OrderLines tables with a Revenue column. I also have a Calendar table with FinancialYear, and a Route table with RouteNo (certain orders are delivered by certain routes). What I'm wanting to do is sum the Revenue for a specific Financial Year and also specific Route Nos. Here is what I've tried:

 

RevenueSum = CALCULATE(
    SUM(OrderLines[Revenue]),
    'Calendar'[FinancialYear] = 2021,
    'Route'['RouteNo] = 160 || 161 || 162
    )
 
Obviously CALCULATE cannot take two filters from different tables like this. What is the workaround? Alternatively, it might be easier for me to remove the FinancialYear filter and use a slicer for FinancialYear instead, but then I'd have to workout how to prevent CALCULATE from overriding the FinancialYear slicer. Any ideas?
 
Thank you.
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @hcr4 

It depends on your data model but in general it can and it should. Not sure if the formula that you shared is exactly as what you've been trying or is just a short syntax but the syntax this way is wrong. Please try

RevenueSum =
CALCULATE (
    SUM ( OrderLines[Revenue] ),
    'Calendar'[FinancialYear] = 2021,
    'Route'['RouteNo] IN { 160, 161, 162 }
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @hcr4 

It depends on your data model but in general it can and it should. Not sure if the formula that you shared is exactly as what you've been trying or is just a short syntax but the syntax this way is wrong. Please try

RevenueSum =
CALCULATE (
    SUM ( OrderLines[Revenue] ),
    'Calendar'[FinancialYear] = 2021,
    'Route'['RouteNo] IN { 160, 161, 162 }
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.