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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bolabuga
Helper V
Helper V

[ Counting Results of a metric ]

Hello Everyone, Is it possible to count the results of metric?? in my case, count the number of the results "+" or "-" or "=". METRIC = IF( [SINAL]<0; "-"; IF( [SINAL]=0; "="; "+"))
1 ACCEPTED SOLUTION

Hi @bolabuga,

 

You could create a calculated column

Trend = IF(Sheet13[Unit]<0,"-",IF(Sheet13[Unit]=0,"=","+"))
And then use this column in a table visual.
Capture1.PNG
Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Not sure about your use of the word "metric". Are you referring to a measure, a table?? If METRIC is a column, you can do this with a CALCULATE(COUNTA([METRIC]),FILTER(Table,[METRIC]="+")), something along those lines. Otherwise, you might want to create a calculated table with your measure and you could do the same basic thing.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

Oh sorry, my bad, the doubt is "COUNTING RESULTS OF A MEASURE" (after so many posts your doubt about "metric"led to me to see that i was refering to "measure" as "metric") Man Frustrated

 

Its a MEASURE that return "+" for results >0, return "-" for results <0 and "=" for results =0.

 

considering i have 2 measures:

 

var ly units = total units - LY units

trend = if( var ly units < 0 ; "-" ; if( var ly units = 0 ; "=" ; "+" ))

 

I would like to count the numbers of times that "-", "+" or "=" will occur when i use the "trend measure" on a list or matrix.

 

Hi @bolabuga,

 

You could create a calculated column

Trend = IF(Sheet13[Unit]<0,"-",IF(Sheet13[Unit]=0,"=","+"))
And then use this column in a table visual.
Capture1.PNG
Capture.PNG

 

Regards,

Charlie Liao

@v-caliao-msft

 

Thanks, that will work.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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