Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I want to calculate the following measure:
Calculate the total number of people last year with or conditions.
Ex: Total Number = CALCULATE(COUNT(Table[Total]), YEAR(Table[DATE])=YEAR(TODAY()-1) && (Table[REASON]="Not well" or "Left the job") && Table[Gender]="F"))
I am not sure about my OR part of the measure as it thrown an error. Basically, what I am trying to calculate is total number which is based on last year and if Reason = Not well or left the job and Gender = Female.
Solved! Go to Solution.
Hey @Anonymous
The OR clause should look like:
(Table[REASON]="Not well" || Table[REASON]="Left the job")
Hope this helps,
Parker
Hi @Anonymous
As mentioned @Anonymous, the OR syntax needs to be changed. Also, the last year part wont retun as expected in your code, you need to change the code as below:
Total Number = CALCULATE(COUNT(Table[Total]),
YEAR(Table[DATE])=YEAR(TODAY())-1
&& (Table[REASON]="Not well" ||Table[REASON]="Left the job")
&& Table[Gender]="F"))Thanks
Raj
Hi @Anonymous
As mentioned @Anonymous, the OR syntax needs to be changed. Also, the last year part wont retun as expected in your code, you need to change the code as below:
Total Number = CALCULATE(COUNT(Table[Total]),
YEAR(Table[DATE])=YEAR(TODAY())-1
&& (Table[REASON]="Not well" ||Table[REASON]="Left the job")
&& Table[Gender]="F"))Thanks
Raj
Thank you @Anonymous @Anonymous!
Hey @Anonymous
The OR clause should look like:
(Table[REASON]="Not well" || Table[REASON]="Left the job")
Hope this helps,
Parker
| User | Count |
|---|---|
| 53 | |
| 42 | |
| 32 | |
| 15 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 72 | |
| 37 | |
| 27 | |
| 24 |