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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Mschronpowerbi
Regular Visitor

Count the number of results from a measure

I am stuck and cannot seem to think of a way to accomplish my goal.
I am making a preformace tracker that provides EOY ratings for our employess.  I have created a measure that converts their weighted scores and returns it as a letter rating.

Mesaure : 

SWITCH(TRUE(),[Total Score]>=4.2,"E",[Total Score]>=3.7,"H",[Total Score]>=3.17,"High",[Total Score]>=2.66,"Mid",[Total Score]>=2.33,"Low",[Total Score]>=2,"M",[Total Score]>0,"U")

I did create a slicer to beable to show only the ratings 

VAR Currentselection = SELECTEDVALUE('Slicer Rating'[Rating])
VAR Currentrating = [Score Rating]
Return
SWITCH(
        TRUE(),
        Currentselection = "EP" && Currentrating = "E", 1,
        Currentselection = "HP" && Currentrating = "H", 1,
        Currentselection = "SP High" && Currentrating = "High", 1,
        Currentselection = "SP Mid" && Currentrating = "Mid", 1,
        Currentselection = "SP Low" && Currentrating = "Low", 1,
        Currentselection = "MP" && Currentrating = "M", 1,
        Currentselection = "UP" && Currentrating = "U", 1,
        Currentselection = "All Ratings", 1,
        0
)

Now I would like to show how many E,H,High,Mid etc.... we have but I cannot figure it out. 
3 REPLIES 3
some_bih
Super User
Super User

Hi @Mschronpowerbi as your measure is working then one of possible solution could be create table with counting or put your measure in some columns and count rows of that table





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Super User
Super User

Hi @Mschronpowerbi your model is not available for details, especially for possible interaction with slicer so it is hard to provide sound possible solution.

In general, counting something similar could be as below as measure. 

COUNTROWS (  <YourTable> )  or CALCULATE( <YourMeasure>, Filter argument)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






All the data comes from different sorces.  How could I connect the weighted scores so that I could beable to count?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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