Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

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

Anonymous
Not applicable

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.