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
BeginnerBob
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
Solution Sage
Solution Sage

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

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.

@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

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.

 

@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

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.