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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Vyshnavi
New Member

I need to find out the contribution for row level

I have a requirement to calculate the rsv data at cell level for postive rsv and negative rsv ans net is positive minus negative .for that i have created the static table with three entries postive rsv ans negative rsv and net rsv .i found the opportunity rsv 

Opportunity RSV = [New RSV]-[RSV]

now i craeted another measure which is rsv threshold for getting postive and negative comaprison .
RSV_Threshold =

var opportunityrsv=[Opportunity RSV]

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

finally i have created the opportunity rsv threshold measure to calculate the sum at cell level .
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 for positive and negative and net rsv . i tried to calculate but it's giving more than 100% how to write query to calculate the contribution by using above logic .

Vyshnavi_0-1728999168791.png

 

 

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

Hi @Vyshnavi ,

 

Please try this measure:

Opportunity Rsv Threshold contribution = 
VAR __total_value = SUMX(ALL('Opportunity RSV'[Opportunity RSV Comparison]),[Opportunity Rsv Threshold])
VAR __curr_value = [Opportunity Rsv Threshold]
VAR __result = DIVIDE( __curr_value, __total_value)
RETURN
__result

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @Vyshnavi ,

 

Please try this measure:

Opportunity Rsv Threshold contribution = 
VAR __total_value = SUMX(ALL('Opportunity RSV'[Opportunity RSV Comparison]),[Opportunity Rsv Threshold])
VAR __curr_value = [Opportunity Rsv Threshold]
VAR __result = DIVIDE( __curr_value, __total_value)
RETURN
__result

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.