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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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