Forum Discussion

mabelsabogal's avatar
mabelsabogal
Frequent Visitor
3 years ago
Solved

Weighted average

Hello,

 

I need to weight a variable by another in Power BI. I have tried several formulae that I have found online to no avail. The results are incorrect when I compare them with the SPSS output that I got previously. What could be the problem?

 

One of the variables I need to weight is: 

Percentage of your new full-time entry-level college hires typically come from interviews initially conducted on-campus
 
And it needs to be weighted by: 
Total number of new college graduate hires at organization
 
Could you please help?
 
Thank you!
 
 
  • I found a solution for this problem: SPSS will automatically not include cases where there isn't data for either the value or the weight you are using but powerbi doesn't do that. You have to go in and manually remove any of those data points in the dataset so that the values return what you get in SPSS. 

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    mabelsabogal See if this helps: 

     

    Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
    Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

  • mabelsabogal's avatar
    mabelsabogal
    Frequent Visitor

    Greg_Deckler 

    Thank you for your reply!

    The weight is not a categorical variable, but numerical. Thus, the quick measure "by category" would not work.

  • mabelsabogal's avatar
    mabelsabogal
    Frequent Visitor

    @Greg_Deckler 

    Here is a small sample of the data:

    Total number of new college graduate hires at your organization (or unit)Percentage of your new full-time entry-level college hires typically come from interviews initially conducted on-campus
    242.0080.00
    2214.00 
    1613.00 
    371.0060.00
    382.00 
    0.0015.00
    120.00 
    400.0015.00
    104.0040.00
  • mabelsabogal's avatar
    mabelsabogal
    Frequent Visitor

    I found a solution for this problem: SPSS will automatically not include cases where there isn't data for either the value or the weight you are using but powerbi doesn't do that. You have to go in and manually remove any of those data points in the dataset so that the values return what you get in SPSS.