cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
skim22 Regular Visitor
Regular Visitor

new measure

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: new measure

Hi @skim22,

 

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

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

3 REPLIES 3
jthomson New Contributor
New Contributor

Re: new measure

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

skim22 Regular Visitor
Regular Visitor

Re: new measure

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."

 

 

Community Support Team
Community Support Team

Re: new measure

Hi @skim22,

 

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

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors