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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
NISHA_S
Resolver I
Resolver I

perentage calculation have some issue

i have some issue in percentage calcuation .Currently am calcualting two types of values..One is count values percentage and one sum values calcualtion like below.

C1.PNG

So,here for count column total is displayed as 101(37+64)..so,percenatge for Category Perecentage of Total is dispalyed correctly..But in commission total is dispalyed like 258479.46...So ..commssion percenatge is calcualted based on these values percentage for Category Perecentage of Total.Why total value for count and Commission is showing differntly...i used below calcualtion for showing values and their grand total values showing as percenatges separtely...

For count =

CALCULATE(DISTINCTCOUNT('table'[policy]),'table'[endt_cert]=0 )
For commission =
CALCULATE(SUM('table'[commission]),'table'[endt_cert]=0 )...

Capture4.PNG

So,total scalculation is differnt in count and commsiion...Why it is like this?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @NISHA_S,

 

Believe that your issue is related with the fact that one of the calculations is based on the DISTINCTCOUNT so only considering one value once even if you have the same value twice example is the last line of your information:

 

MFelix_0-1620633790957.png

and the other calculation is based on the SUM considering the case above your total value will be 16.428.

 

The totals are based on the context of the measure so your sum for the total is the sum of all the values above you may need to change your measure in order to have the calculation correctly made something similar to:

 

For commission =
IF (
    HASONEVALUE( 'table'[category] ),
    CALCULATE ( SUM ( 'table'[commission] ), 'table'[endt_cert] = 0 ),
    CALCULATE (
        SUM ( 'table'[commission] ),
        'table'[endt_cert] = 0
            && 'table'[category] = "Percentage of Total"
    )
)

 

Be aware that may be some variations for it to work on your model based on the setup you have.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @NISHA_S,

 

Believe that your issue is related with the fact that one of the calculations is based on the DISTINCTCOUNT so only considering one value once even if you have the same value twice example is the last line of your information:

 

MFelix_0-1620633790957.png

and the other calculation is based on the SUM considering the case above your total value will be 16.428.

 

The totals are based on the context of the measure so your sum for the total is the sum of all the values above you may need to change your measure in order to have the calculation correctly made something similar to:

 

For commission =
IF (
    HASONEVALUE( 'table'[category] ),
    CALCULATE ( SUM ( 'table'[commission] ), 'table'[endt_cert] = 0 ),
    CALCULATE (
        SUM ( 'table'[commission] ),
        'table'[endt_cert] = 0
            && 'table'[category] = "Percentage of Total"
    )
)

 

Be aware that may be some variations for it to work on your model based on the setup you have.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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