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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.