cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BeginnerBob Frequent Visitor
Frequent Visitor

String Measure Count

Hi,

 

I have a calculated measure which is called Total Score this is a DAX formula.

 

I have a static lookup table (ScoreOverall) which holds the score categories ie.

 

Category      Low Score                High Score

Poor              0                              5

Good             5                              10

Great              10                           15

 

What I have done at the moment is to create another measure which returns a string (not sure whether this will perform that well):

 

Total Score Category:= IF(VALUE([Total Score]) <> BLANK(),CALCULATE(VALUES(ScoreOverall[Name]),FILTER(ScoreOverall,[Total Score] >= ScoreOverall[FromRange] && [Total Score] <ScoreOverall[ToRange] )))

 

The issue that I have is  I can't count this score in PowerBI. For eaxmple for a particular filter I would want to know that 3 customers were poor, 2 were good and 5 were great.

 

How do I acheive this?

 

Thanks

Bob

5 REPLIES 5
quentin_vigne Senior Member
Senior Member

Re: String Measure Count

Hi @BeginnerBob

 

Could you please share with us a sample of your data ? We don't have all of the information to solve your problem 

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

 

- Quentin

Highlighted
BeginnerBob Frequent Visitor
Frequent Visitor

Re: String Measure Count

Sorry the table should have the headers: 

 

Name      FromRange               ToRange

Poor              0                              5

Good             5                              10

Great              10                           15

 

Total Score: Is a measure made up of other scores.

 

Hope this helps.

quentin_vigne Senior Member
Senior Member

Re: String Measure Count

@BeginnerBob

 

I'm sorry but can you please detail :

 

What is your expected result (what value are you expecting, based on what ?)

What are the other values that you are using to make calculation (for example Total score if it is a criteria)

 

- Quentin

BeginnerBob Frequent Visitor
Frequent Visitor

Re: String Measure Count

The result is the Name i.e. Poor, Good or Great. My issue is I can't count these within PowerBI.

 

Total Score is an integer. If the Total Score is, 3 Poor will be returned. If it's 6, Good will be returned.

 

How do I count a calculated measure within DAX? The Measure is a string value.

 

quentin_vigne Senior Member
Senior Member

Re: String Measure Count

@BeginnerBob

 

What are you counting ?

The number of time poor and good appear ? 

The SUM() of FromRange or ToRange ?

 

If the measure is a string value you can use the VALUE() function

 

I need better explanation on this if you want me to help you better