March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello
Can you tell me please how to use the CALCULATE formula with multiple OR/AND criteria?
Thanks!
Solved! Go to Solution.
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.
@UsePowerBI , 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"))
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |