Forum Discussion

fergmn's avatar
fergmn
Frequent Visitor
3 years ago
Solved

SUM/Count in Power Bi

Hi, I was wondering if there is a way to sum my sales data instead of it showing the count in PowerBi. I want to look at the sum of sales instead of the count in some of my charts. 

  • Well I believe the error message says it all. The HMO[Sales] field is a text field - not a numerical field. You have change the type of the field first.

13 Replies

  • JirkaZ's avatar
    JirkaZ
    Solution Specialist

    Sure - create a measure for whatever calculation you need. 

     

    Example (Sum of sales amount):

    My Sales Amount := SUM('MyFactTable'[Sales Amount])
    • fergmn's avatar
      fergmn
      Frequent Visitor

      Do I create this measure before inserting any graphs? 

      • JirkaZ's avatar
        JirkaZ
        Solution Specialist

        Creating Measures (calculations) is part of the data modeling/preparation. So you do that before you visualize the data.

    • fergmn's avatar
      fergmn
      Frequent Visitor

      Hi JirkaZ, 

       

       

       

      I tried the measure MySalesAmount:=SUM(HMO[Sales]) and it didn't work am I do doing something wrong.

      • JirkaZ's avatar
        JirkaZ
        Solution Specialist

        Please give more details. What exactly didn't work, where are you stuck? Maybe a couple of screenshots with the definition and the way you're trying to use it would help.