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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Vyshnavi
New Member

i got contribution more 100% how to resolve these issue ... below i have shared the logic

I need to calculate th contribution for opportunity rsv  threshold .but i'm getting more than 100%

first i calcualted the opportunity rsv logic 
Opportunity RSV = [New RSV]-[RSV]

later i created the driving measure to get postive and negative data.
RSV_Threshold =

var opportunityrsv=[Opportunity RSV]

return if(opportunityrsv < 0 ,-1,IF([Opportunity RSV]>0,1,0))

i calculated the rsv threshold at cell level i summed up opportunity rsv .
Opportunity Rsv Threshold =

VAR positive_opportunity_rsv = SUMX (
'Target',
IF ('Target'[RSV_Threshold]=1 , [Opportunity RSV], 0 )
)
VAR negative_opportunity_rsv = SUMX (
'Target',
IF ( 'Target'[RSV_Threshold] = -1, [Opportunity RSV], 0 )
)
VAR net_rsv = positive_opportunity_rsv - negative_opportunity_rsv

var Opportunityrsv=
SWITCH(
MAX('Opportunity RSV'[Opportunity RSV Comparison]) ,
"Negative opportunity RSV",negative_opportunity_rsv ,
"Positive opportunity RSV", positive_opportunity_rsv ,
"NET Opportunity RSV", net_rsv)

return IF(ISBLANK(SUM('Time Progression'[Progression Offset])), BLANK(), Opportunityrsv)

 now i need to calculate the contribution intried the below logic but it's giving more than 100% how to resolve these.

Opportunity Rsv Threshold contribution =
var totarsv=CALCULATE(SUMX(Target, [Opportunity RSV]),ALL(Target))
VAR positive_opportunity_rsv = SUMX (
            'Target',
            IF ('Target'[RSV_Threshold]=1 , [Opportunity RSV], 0 )
        )
VAR negative_opportunity_rsv = SUMX (
            'Target',
            IF ( 'Target'[RSV_Threshold] = -1, [Opportunity RSV], 0 )
        )
VAR net_rsv = positive_opportunity_rsv +negative_opportunity_rsv

var Opportunityrsv=  
SWITCH(
        MAX('Opportunity RSV'[Opportunity RSV Comparison]) ,
    "Negative opportunity RSV",DIVIDE(negative_opportunity_rsv,totarsv) ,
    "Positive opportunity RSV", DIVIDE( positive_opportunity_rsv,totarsv) ,
    "NET Opportunity RSV",DIVIDE( net_rsv,totarsv))
       
return IF(ISBLANK(SUM('Time Progression'[Progression Offset])), BLANK(), Opportunityrsv)
   
1 ACCEPTED SOLUTION
Vyshnavi
New Member

var totarsv=CALCULATE(SUMX(Target, [Opportunity RSV]),ALL(Target))
VAR positive_opportunity_rsv = SUMX (
            'Target',
            IF ('Target'[RSV_Threshold]=1 , [Opportunity RSV], 0 )
        )
VAR negative_opportunity_rsv = SUMX (
            'Target',
            IF ( 'Target'[RSV_Threshold] = -1, [Opportunity RSV], 0 )
        )
VAR net_rsv = positive_opportunity_rsv +negative_opportunity_rsv

 

var Opportunityrsv=  
SWITCH(
        MAX('Opportunity RSV'[Opportunity RSV Comparison]) ,
    "Negative opportunity RSV",DIVIDE(negative_opportunity_rsv,totarsv) ,
    "Positive opportunity RSV"DIVIDE( positive_opportunity_rsv,totarsv) ,
    "NET Opportunity RSV",DIVIDE( net_rsv,totarsv))
       
return IF(ISBLANK(SUM('Time Progression'[Progression Offset])), BLANK(), Opportunityrsv)
   these logic is giving more than 100%
 

View solution in original post

3 REPLIES 3
Vyshnavi
New Member

Vyshnavi_0-1729056461272.png

the measure i'm using 

contribution =
var Total_RSV =
CALCULATE([Opportunity RSV],  FILTER(Target,[RSV_Threshold] = 1 || 'Target'[RSV_Threshold] = -1),REMOVEFILTERS('Target'))


VAR Positive_RSV =
SUMX(
    'Target',
    IF('Target'[RSV_Threshold] = 1, [Opportunity RSV], 0)
)

VAR Negative_RSV =
SUMX(
    'Target',
    IF('Target'[RSV_Threshold] = -1, [Opportunity RSV], 0)
)

VAR Net_RSV = Positive_RSV - Negative_RSV


VAR Positive_Contribution =
DIVIDE(Positive_RSV, Total_RSV, 0)

VAR Negative_Contribution =
DIVIDE(Negative_RSV, Total_RSV, 0)

VAR Net_Contribution =
DIVIDE(Net_RSV, Total_RSV, 0)

RETURN
SWITCH(
    MAX('Opportunity RSV'[Opportunity RSV Comparison]),
    "Positive opportunity RSV", Positive_Contribution,
    "Negative opportunity RSV", Negative_Contribution,
    "NET Opportunity RSV", Net_Contribution,
    BLANK()
)
Vyshnavi
New Member

var totarsv=CALCULATE(SUMX(Target, [Opportunity RSV]),ALL(Target))
VAR positive_opportunity_rsv = SUMX (
            'Target',
            IF ('Target'[RSV_Threshold]=1 , [Opportunity RSV], 0 )
        )
VAR negative_opportunity_rsv = SUMX (
            'Target',
            IF ( 'Target'[RSV_Threshold] = -1, [Opportunity RSV], 0 )
        )
VAR net_rsv = positive_opportunity_rsv +negative_opportunity_rsv

 

var Opportunityrsv=  
SWITCH(
        MAX('Opportunity RSV'[Opportunity RSV Comparison]) ,
    "Negative opportunity RSV",DIVIDE(negative_opportunity_rsv,totarsv) ,
    "Positive opportunity RSV"DIVIDE( positive_opportunity_rsv,totarsv) ,
    "NET Opportunity RSV",DIVIDE( net_rsv,totarsv))
       
return IF(ISBLANK(SUM('Time Progression'[Progression Offset])), BLANK(), Opportunityrsv)
   these logic is giving more than 100%
 
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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