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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BlackCat
Helper III
Helper III

Need to create a weighted measurement

I have to create a weighted measurement for a Standard report and now I must create a weighted measurement for the monthly revenue. The calculation used for the Excel report was 

return (Math.Round((TotalRev / NumOfMonths) * (Probability / 100), 2));
I understand that the opportunity status will define the probability that it will close on , so I have to create a logic to split them up, but my calculations are not appearing correct.
 
 
 

Power BI_weighted measurement example.png

7 REPLIES 7
v-stephen-msft
Community Support
Community Support

Hi @BlackCat ,

 

Sorry, not very clear.

 

Please provide some sample data and the expected result.

 

Do you want to calculate the revenue divided by the number of months after the slicer filters the date?

 

Best Regards,

Stephen Tao

 

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

Hi Stephen,

I have sent a screenshot of what I am trying to accomplish. Basically I have a report already configured with the following headers: Divisions, Proposal number, Full Name, Oppurtunity status, Deal Stage %, Opportunity Title, Client, Region and you can see the other headers. I've highlighted the calculations I have to perform to add those fields to the report. I am having difficulty as I am new to this type of reporting in BI. Any help is much appreciated.

Deal Stage Calculation.png

Rolling forecast_Standard.pngRolling forecast_weighted.png

To Calculate Standard and Weight monthly revenues we used the below code in excel

Standard:

            return (Math.Round((TotalRev / NumOfMonths), 2));

Weighted:

            return (Math.Round((TotalRev / NumOfMonths) * (Probability / 100), 2));


So total revenue you would know from the deal and the number of Months you would calculate base on the number of months between the deal contract starts and ends.

For my standard calculation, I used this measurement in Power BI

Revenue =
ROUND(
CALCULATE(
SUMX(Deal, [Contract Value per Month] * [Selected Months] /*(DATEDIFF(MAX(MIN('Revenue Calendar'[Date]),[Contract Start]), MIN(MAX('Revenue Calendar'[Date]),[Contract End]), MONTH) + 1) */ )
, FILTER(Deal
, Deal[Contract Start] <= MAX('Revenue Calendar'[Date]) && Deal[Contract End] >= MIN('Revenue Calendar'[Date])
)
)
, 0
)

For the weighted calculations it figures out what % it is by using the “Opp Status” selected for the opportunity. I can send you the report in a private message, I'll replace the real data with fictional.

Anonymous
Not applicable

@BlackCat could you please post the calculation you've tried in Power BI? 

Hi Sean, this is the calculation I used...but doesn't seem correct. 

Monthly Revenue RT(MY) weighted by Opportunity Status =
VAR __CATEGORY_VALUES = VALUES('DealPipelineStage'[Opportunity Status])
RETURN
    DIVIDE(
        SUMX(
            KEEPFILTERS(__CATEGORY_VALUES),
            CALCULATE(
                [Monthly Revenue RT(MY)]
                    * COUNTA('DealPipelineStage'[Probability])
            )
        ),
        SUMX(
            KEEPFILTERS(__CATEGORY_VALUES),
            CALCULATE(COUNTA('DealPipelineStage'[Opportunity Status]))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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