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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Snehal_123
Frequent Visitor

Measure to count people scoring below 50 %

Hi,

I want a solution for the following scenario.
I have a table with names and percentages.
I want a power query to count the people who have scored 70% to 80%

Thank you
Power query 

 

 

 

 

5 REPLIES 5
mukeshkasi25
Frequent Visitor

Hi @Snehal_123 

We can create a measure to count number of peple scoring below the required condition.
the syntax would be like:
Measure= CALCULATE(COUNT(TABLE'PERCENTAGE'), FILTER(TABLE, TABLE(PERCENTAGE)<50%))

Mahesh0016
Super User
Super User

@Snehal_123 can you please share your EndOutPut?

Input:

NamePercentage
A50.00%
B23.00%
C54.00%
A62.00%
B78.00%
C93.00%
A90.00%
B34.00%
C19.00%
A44.00%
B89.00%
C77.00%
A34.00%


Desired Output:

Below 50%6
51% to 80%4
Above 80%3

Use this code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TczBDcAgDEPRXXxGFSUpIceWMSL2X6MiXHz88pMj8KKgXk/FKoEvo0nGPItmHNYbMRvEXIg5v4kSu52YKrHhxMyI7YP1Aw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Percentage = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Percentage", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Category", each if [Percentage] <= 0.5 then "Below 50%" else if [Percentage] <= 0.8 then "51% to 80%" else "Above 80%"),
    #"Grouped Rows" = Table.Group(#"Added Custom", {"Category"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"
Vijay_A_Verma
Super User
Super User

Replace Source{Percentage] appropriately

=List.Count(List.Select(Source[Percentage], (x)=>x>=0.7 and x<=0.8))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.