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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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