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
ionutbolos
Regular Visitor

How to divide certains values from a column with the total of the column

Hello Everyone

 

I am trying to divide certain values from a column with the total column.

 

Below is a sample:

 

Rating Experience

Negative

Negative

Negative

Positive

Neutral

Positive

Neutral

Positive

Negative

 

I this case I am trying to divide the negatives with the total number of the column.

 

 

 

1 ACCEPTED SOLUTION
Ronald123
Resolver III
Resolver III

@ionutbolos ,

 

Try this;

Sample = DIVIDE(
    CALCULATE(
    COUNT('Table'[Rating Experience]);
    'Table'[Rating Experience]="Negative");
    COUNTROWS('Table'))

Greetz,

 

Ronald

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @ionutbolos ,

 

Here we can format the measure to percentage instead of changing it in visual. As in visual, you might get the percentage of some other category.

 

2.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

I think this should work

Measure=
VAR __Count= COUNTROWS( TABLE )

VAR __NegCount =
    CALCULATE(
        __Count,
        TABLE[RATNG EXPERIENCE]= "Negative"
    )

RETURN

DIVIDE (__NegCount,__Count)

Ronald123
Resolver III
Resolver III

@ionutbolos ,

 

Try this;

Sample = DIVIDE(
    CALCULATE(
    COUNT('Table'[Rating Experience]);
    'Table'[Rating Experience]="Negative");
    COUNTROWS('Table'))

Greetz,

 

Ronald

Thanks! That worked. It shows the correct value (eg. below 0.14) but when it transforms it into percentage in the pie chart it shows a different value. Do you happen to know why it showing like this?

 

Untitled.jpg

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.