Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello Everyone,
I was recently introduced to DAX and creating "New Measures" and I am in need of some help. I want to create a new measure that combines and counts the number of 2 unique values into 1. I have a column in my data set called "Call Reason" and this column contains the reason for the phone call. There are 3 categories of call reasons: 1) No Repair Information; 2) Repair Information Incorrect; 3) Repair Information Not Available. For my purposes, I want to combine call reason 1 & 3 because its essetially the same thing. I want my "New Measure" to count all the instances of call reason 1 & 3 into 1 value. How do I write this DAX expression? Please help! Thank you!
Solved! Go to Solution.
Hi @Anonymous,
You can try to use below formula:
formula = COUNTROWS ( FILTER ( ALL ( WSMTotal ), [Call Reason] IN {"No Repair Information","Repair Information Not Availab"} ) )
Regards,
Xiaoxin Sheng
calculate(countrows([yourtablename],[call reason]="No Repair Information"||[call reason]="Repair Information Not Available]))
Probably need to tweak the syntax so it addresses your table and columns correctly, but the || is basically saying one or the other.
If you didn't need the two to be different at all in your report, you could also alter one of the values at the query stage so that they all say the same thing
Thanks for replying jthomson! I am getting an error when applying the function you provided.
CALCULATE(COUNTROWS([WSM Total],[Call Reason]="No Repair Information" || "Repair Information Not Availab"))
The error msg I get is - "Too many arguments were passed to the COUNTROWS function. The maximum aregument count for the function is 1."
Hi @Anonymous,
You can try to use below formula:
formula = COUNTROWS ( FILTER ( ALL ( WSMTotal ), [Call Reason] IN {"No Repair Information","Repair Information Not Availab"} ) )
Regards,
Xiaoxin Sheng
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |