Forum Discussion

kg4u's avatar
kg4u
Icon for Helper II rankHelper II
3 years ago
Solved

Calculated Column is not returning any results

Hi,

 

I want to sum three measures to create a "Grand Total".  I thought I could accomplish this with a calculated column.  When I create the column, the results are empty.  What am I doing wrong?

 

Here is the formula for my calculated column:

Scripting Score = 'Facts'[Total Recorded Call Points] + 'Facts'[Total Prod Desc Score] + 'Facts'[Total Payment Score]
 
When I try to use the new column the results are empty.

I would like to see the value of 86 for the Scripting Score. How can I achieve this? 

Thanks in advance for your help

 
  • Hi kg4u 
    HotChilli is right here. I would create measures rather then calculated columns, then they can be used all over your model.

    Set up following measures:
    Tot Recorded Call Score = SUM('Facts'[Total Recorded Call Score])
    Tot Prod Desc Score = SUM('Facts'[Total Prod Desc Score])
    Tot Payment Score = SUM('Facts'[Total Payment Score])
    Scripting Score = [Tot Recorded Call Score] + [Tot Prod Desc Score] +[Tot Payment Score]

    Similar logic for Points.
    Then Scripting Rating = DIVIDE([Scripting Score], [Scripting Points])

    The difference here between a column and a measure is that the calculated column leaves the calculation static and you'd end up adding individual scripting rating results. WIth a Measure you can apply it to any visual and it will work within the context of that visual

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

    Pete
    Web: https://binavigation.com
    Linked In: https://www.linkedin.com/in/pete-smith-955b73181


     

     

5 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    It's a context thing.

    Measures are dynamic and should be used in visuals.  Calculated columns are static and evaluated when powerbi loads.

    It is possible to use measures in calculated columns but not recommended.

  • Hi Hot Chilli,

     

    Is there a different way in which I can accomplish what I am trying to do?  I want to sum three measures together to create a grand total.  Thanks!

    • kg4u's avatar
      kg4u
      Icon for Helper II rankHelper II

      I ultimately want to use the Grand Total in another calculation.  Please review the scenario below and let me know if there is a possible solution to what I am trying to accomplish.  Thank you.

       

      Scripting Score = 'Facts'[Total Recorded Call Score] + 'Facts'[Total Prod Desc Score] + 'Facts'[Total Payment Score]

       

      Scripting Points = 'Facts'[Total Recorded Points] + 'Facts'[Total Prod Desc Points[ + 'Facts'[Total Payment Points]

       

      Scripting Rating = DIVIDE([Scripting Score], [Scripting Points])

       

      • BiNavPete's avatar
        BiNavPete
        Icon for Resolver III rankResolver III

        Hi kg4u 
        HotChilli is right here. I would create measures rather then calculated columns, then they can be used all over your model.

        Set up following measures:
        Tot Recorded Call Score = SUM('Facts'[Total Recorded Call Score])
        Tot Prod Desc Score = SUM('Facts'[Total Prod Desc Score])
        Tot Payment Score = SUM('Facts'[Total Payment Score])
        Scripting Score = [Tot Recorded Call Score] + [Tot Prod Desc Score] +[Tot Payment Score]

        Similar logic for Points.
        Then Scripting Rating = DIVIDE([Scripting Score], [Scripting Points])

        The difference here between a column and a measure is that the calculated column leaves the calculation static and you'd end up adding individual scripting rating results. WIth a Measure you can apply it to any visual and it will work within the context of that visual

        Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

        Pete
        Web: https://binavigation.com
        Linked In: https://www.linkedin.com/in/pete-smith-955b73181