Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Quality over Quantity
@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.
Quality over Quantity
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |