Forum Discussion

kunal_mehta1's avatar
kunal_mehta1
Helper I
3 years ago
Solved

Dax to Sum Rows

Hi All,
I want to have dax expression for power BI to sum multiple rows.
I want a measure which would sum the dollar value of A1 and dollar value of B1 and give me a total of 30.
Thanks.

  • v-zhangti's avatar
    v-zhangti
    3 years ago

    Hi, kunal_mehta1 

     

    You can try the following methods.
    Column:

    Number = RIGHT([Project Number],4)

    Measure = CALCULATE(SUM('Table'[Dollar]),ALLEXCEPT('Table','Table'[Number]))

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

6 Replies

  • hi kunal_mehta1 

    try like:

    measure =
    CALCULATE(
       SUM(TableName[Dollar]),
       TableName[ProjectNumber] IN {"A1", "B1"}
    )
    • kunal_mehta1's avatar
      kunal_mehta1
      Helper I

      Sorry, i would like to elaborate a little.
      I have projects with C number and out of those C projects i have few O projects with the same last 4 digits.
      I want to sum the dollar values of C and O for that particular project with same last 4 digits.
      I want a measure which would sum the C and O rows with same last 4 digits and if it doesn't have the O number just give the value of C number row.
      I hope that this makes it clear.

  • Hi,

    I am not sure how your expected outcome of a visualization looks like, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.