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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
aafflick
Frequent Visitor

Calculate percentage of customers with specific text values

I am trying to calculate the percentage of customers that fall into a specific rank. I want to show what % of customers are in each DIA Rank (High, Medium, Low). For example, 23.34% of customers have DIA Rank of "High". My sample data is listed below. 

 

Table Name = DIA May and June

CustomerDIA Rank

ABC Store

High

Supermart

Medium

Tech Center Pro

Low

Super Center

Low

Home Goods

Medium

Target

High
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @aafflick 

 

Try this measure:

Measure 2 =
VAR _count =
    CALCULATE (
        COUNT ( 'DIA May and June'[Customer] ),
        ALLEXCEPT ( 'DIA May and June', 'DIA May and June'[DIA Rank] )
    )
VAR total =
    CALCULATE ( COUNTROWS ( ALL ( 'DIA May and June' ) ) )
RETURN
    DIVIDE ( _count, total )

test_Calculate percentage of customers with specific text values.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @aafflick 

 

Try this measure:

Measure 2 =
VAR _count =
    CALCULATE (
        COUNT ( 'DIA May and June'[Customer] ),
        ALLEXCEPT ( 'DIA May and June', 'DIA May and June'[DIA Rank] )
    )
VAR total =
    CALCULATE ( COUNTROWS ( ALL ( 'DIA May and June' ) ) )
RETURN
    DIVIDE ( _count, total )

test_Calculate percentage of customers with specific text values.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This worked perfectly! Now, how to I add a filter to the measure to only include data where (DIA May and June) [DIA % Change] is equal to or less than -.20?

parry2k
Super User
Super User

@aafflick try this measure

 

Base Measure = COUNTROWS ( Table )

% Count = DIVIDE ( [Base Measure], CALCULATE ( [Base Measure], ALLSELECTED ( Table ) ) )

 

In a visual, put DIA Rank and above measure, and you will get the %, Make sure to change the format of above measure to % on measure tools menu.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors