Forum Discussion
Creating a custom measure
I am working with a data set that shows how where the prescription order originated from (column RPORDORIG); this column has the following entries: "E" for electronic, "W" for written, "P" for phone, "V" for Verbal, "O" for outpatient and then several blanks.
I need to create a custom measure to display (with a gauge visual) the percent of how many orders out of all of these order origins were "E" electronic. AKA the "E" orders will be the numerator and all orders in total will be the denominator.
I tried to create a measure using the CALCULATE(COUNTROWS(Table,' Column')) measure but it didn't work. Not sure what I'm doing wrong or if I should be doing something different.
Is there a way to only include the "W" "P" & "V" orders in the denominator, instead of all the orders??
Denominator = CALCULATE ( COUNTROWS ( 'MD Master Query CPOE' ), 'MD Master Query CPOE'[RPORDORIG] IN { "W", "P", "V" } )
3 Replies
- jdbuchanan71Super User
Denominator = CALCULATE ( COUNTROWS ( 'MD Master Query CPOE' ), 'MD Master Query CPOE'[RPORDORIG] IN { "W", "P", "V" } ) - Jihwan_KimSuper User
Hi, Anonymous
For Denominator, try the below.
Denominator = countrows (only table name)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
- AnonymousNot applicable
HI Anonymous,
I'd like to suggest you take a look at the following link about Dax string comparison:
From SQL to DAX: String Comparison
Regards,
Xiaoxin Sheng