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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Percentage of total

Hi guys,

 

I'm looking for some help with calculating a percentage per group and then the difference between the two. These are 2 matrixes coming from customer satisfaction surveys:

 

NPS PowerBI.JPG

 

The first one has all the results from 0-10 that clients can give us, with the number of times we got the specific result. The second matrix has the results grouped. 9-10 = Promoter, 7-8 are Passive, 0-6 Detractors. The number of times is just a measure using a count formula. The grouping in the 2nd matrix has been made in the column Net_Promoter_Score in the table FactsB2CRawdata. So the column name is 'FactsB2CRawdata'[Net_promoter_Score(groups)]

 

I'm now looking to create 2 calculations

- the percentage of "Detractor", "Passive" or "Promoter" vs total

- the outcome of % Promoters - % Detractors

 

Thanks in advance for your help,

best regards,

Jeroen

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

Hi @Anonymous ,

According to your description, I create a sample.

vkalyjmsft_0-1647590126514.png

This is my formula of times measure.

Tims =
CALCULATE (
    COUNT ( FactsB2CRawdata[Net_Promoter_Score] ),
    FILTER ( 'FactsB2CRawdata', 'FactsB2CRawdata'[Result] = "Yes" )
)

Get the correct result as yours.

vkalyjmsft_1-1647590264300.png

Here's my solution.

Create two measures.

Percentage = DIVIDE([Tims],CALCULATE([Tims],ALL(FactsB2CRawdata)))
% Promoters - % Detractors =
CALCULATE (
    [Percentage],
    'FactsB2CRawdata'[Net_Promoter_Score(groups)] = "Promoter"
)
    - CALCULATE (
        [Percentage],
        'FactsB2CRawdata'[Net_Promoter_Score(groups)] = "Detractor"
    )

Put the Percentage in the Values of the matrix, get the correct result.

vkalyjmsft_2-1647590419943.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample.

vkalyjmsft_0-1647590126514.png

This is my formula of times measure.

Tims =
CALCULATE (
    COUNT ( FactsB2CRawdata[Net_Promoter_Score] ),
    FILTER ( 'FactsB2CRawdata', 'FactsB2CRawdata'[Result] = "Yes" )
)

Get the correct result as yours.

vkalyjmsft_1-1647590264300.png

Here's my solution.

Create two measures.

Percentage = DIVIDE([Tims],CALCULATE([Tims],ALL(FactsB2CRawdata)))
% Promoters - % Detractors =
CALCULATE (
    [Percentage],
    'FactsB2CRawdata'[Net_Promoter_Score(groups)] = "Promoter"
)
    - CALCULATE (
        [Percentage],
        'FactsB2CRawdata'[Net_Promoter_Score(groups)] = "Detractor"
    )

Put the Percentage in the Values of the matrix, get the correct result.

vkalyjmsft_2-1647590419943.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

Whitewater100
Solution Sage
Solution Sage

Hello:

The general measure for this type of calculation is

Share % = DIVIDE(SUMX(FactsB2CRawdata[Net_promoter_Score(groups)],

SUMX(ALLSELECTED(FactsB2CRawdata), [Net_promoter_Score(groups)]))

 

Where the factable is the first part and your measure goes with it. You may need to substitute your inital count measure for the first share of total.

 

I hope this helps!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.