Forum Discussion

Yunxijiang's avatar
Yunxijiang
Regular Visitor
8 years ago
Solved

SUMX CALCULATION TOTAL

Hello,

 

I'm New to Power BI, Can you please help me with SUMX formula to calculate total value of a colone mesure ?

 

My data table in Excel is like Pic1, and the table in Powzer BI is like Pic2 , in which I add a measure of GAP= ABS( SUM(Sales) -SUM(Fcst))

Then I want to get a value of tatol Gap in a colone like this : GAP 1 = 1+3+1+1=6 instead of 2 

 

and next step I want to make a measure of the total GAP1+GAP2+GAP3.

 

 

  • Hi Yunxijiang

     

    You could create the formulas like below.

    Measure = SUMX('Table1',[GAP_1])
    Measure 2 = SUMX('Table1',[GAP_2])
    Measure 3 = SUMX('Table1','Table1'[GAP_3])
    Measure 4 = [Measure]+[Measure 2]+[Measure 3]

    Here is the result output.

     

    If you only need the measure 4, you also could modify the measure to Measure 5 = SUMX('Table1',[Measure])+SUMX('Table1',[Measure 2])+SUMX('Table1',[Measure 3])

     

    Hope this can help you!

     

    Best Regards,

    Cherry

5 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Yunxijiang

     

    You could create the formulas like below.

    Measure = SUMX('Table1',[GAP_1])
    Measure 2 = SUMX('Table1',[GAP_2])
    Measure 3 = SUMX('Table1','Table1'[GAP_3])
    Measure 4 = [Measure]+[Measure 2]+[Measure 3]

    Here is the result output.

     

    If you only need the measure 4, you also could modify the measure to Measure 5 = SUMX('Table1',[Measure])+SUMX('Table1',[Measure 2])+SUMX('Table1',[Measure 3])

     

    Hope this can help you!

     

    Best Regards,

    Cherry

    • Yunxijiang's avatar
      Yunxijiang
      Regular Visitor
      Thank you very much Cherry!
      Best regards

      Yunxi