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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

CALCULATE with multiple OR/AND criteria

Hello

 

Can you tell me please how to use the CALCULATE formula with multiple OR/AND criteria?

 

Thanks!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

When you add two filters to the CALCULATE Function, this is equavalient to using AND. So if you wanted to get the Direct or Referral Channels. You will need to use the || to create OR in CALCULATE and FILTER

Direct OR Refferal Sessions =

CALCULATE(SUM('All Web Site Data'[Sessions]),
FILTER('All Web Site Data','All Web Site Data'[Default Channel Grouping]="Direct" || 'All Web Site Data'[Default Channel Grouping]="Referral"))

When you want to use the OR condition, Use FITLER with CALCULATE.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , you have AND and OR function

You can use && for and; and || for or

 

example = calculate([measure],filter(Table, Table[A] =1 || Table[B] ="A"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

When you add two filters to the CALCULATE Function, this is equavalient to using AND. So if you wanted to get the Direct or Referral Channels. You will need to use the || to create OR in CALCULATE and FILTER

Direct OR Refferal Sessions =

CALCULATE(SUM('All Web Site Data'[Sessions]),
FILTER('All Web Site Data','All Web Site Data'[Default Channel Grouping]="Direct" || 'All Web Site Data'[Default Channel Grouping]="Referral"))

When you want to use the OR condition, Use FITLER with CALCULATE.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors