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
Anonymous
Not applicable

Calculate count of percentage and place in a

Hi All,

I have prepared the result of my dataset in excel and am unable to do so in PBI. Below is the required result:

 

1. I have 4 categories- A, B, C, D

2. These categories are further divided into Worst, Bad, Good, Very Good- This will go on X-axis 

3. On Y-axis, there are 4 categories of %- <10%, 10-20%, 20-30%

 

Now for every category in point 1 A, B, etc, I will calculate total % in category 2 and enter the count in category 3. 

 

For eg, if for A, B the individual calculation for "Worst" come to be <10%, then it should enter the count as 2 in that bracket.

 

Worst: A=9%, B=6%, C=15%

Bad: A= 15%, B=5%, C=16%

 

Below is the excel version and I need to create a matrix in PBI. Somehow I am unable to segregate based on the count of percentages.

40-100    
20-40    
10-20%12  
<10%21  
 WorstBadGoodVery Good

 

Thanks!

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a column

Category 3 =
SWITCH (
    TRUE (),
    Table1[VALUE] < 0.1, "<10%",
    Table1[VALUE] < 0.2
        && Table1[VALUE] >= 0.1, "10%-20%",
    Table1[VALUE] < 0.4
        && Table1[VALUE] >= 0.2, "20%-40%",
    Table1[VALUE] <= 1
        && Table1[VALUE] >= 0.4, "40%-100%"
)

Create a measure

Measure = CALCULATE(COUNTROWS(Table1),ALLEXCEPT(Table1,Table1[category2],Table1[Category 3]))

3.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a column

Category 3 =
SWITCH (
    TRUE (),
    Table1[VALUE] < 0.1, "<10%",
    Table1[VALUE] < 0.2
        && Table1[VALUE] >= 0.1, "10%-20%",
    Table1[VALUE] < 0.4
        && Table1[VALUE] >= 0.2, "20%-40%",
    Table1[VALUE] <= 1
        && Table1[VALUE] >= 0.4, "40%-100%"
)

Create a measure

Measure = CALCULATE(COUNTROWS(Table1),ALLEXCEPT(Table1,Table1[category2],Table1[Category 3]))

3.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors