Forum Discussion

KarlheinzLedere's avatar
KarlheinzLedere
New Member
5 years ago
Solved

Add column filled with sum from one column based on other column / Power BI

I have a data that looks like this:

 

I need a formula to add a column and fill a field in the same line, when “Tabelle1.Product” is filled (in Excel IF), it should cumulate “Revenue_Euro” where “sales_acct_unit3” is the same (in Excel SUMIF).

 

Anyone can point me in the right diection?

  • Anonymous's avatar
    Anonymous
    5 years ago

    KarlheinzLedere 

     

    The description is a bit confusing but I guess I see your requirement. Try create the following measure:

    Measure = If(max([Tabelle1.Product])<>Blank(), Calcuate(sum([Revenue_Euro]), filter(allselected(table), [sales_acct_unit3]=Max([sales_acct_unit3]))))


    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

     

3 Replies

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

    Hi KarlheinzLedere 

    You need to provide more info. Cumulative over what? Date? Since when?

    What fields do you have as rows in your table visual (i.e., determining the context filter)?

    Can you show a sample of your table?

    Or ideally share the pbix 

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

     

     

  • Hello @AIB,

     

    i added a picture in there where you can see the table.

    I have the column "“sales_acct_unit3”" which is filled with different values, in my example its "S530". And i need a field filled in an extra coumn in the same row as there a values in the column "Tabelle1.product" having the sum of the column "Revenue_Euro" where all have the same value in "“sales_acct_unit3”"

     

    In that example: In the row where "Sigma" is the value, i want a field next to "Sigma" with the sum of all "S530" fields, because in the row with Sigma the value of “sales_acct_unit3” the value is "S530"

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    KarlheinzLedere 

     

    The description is a bit confusing but I guess I see your requirement. Try create the following measure:

    Measure = If(max([Tabelle1.Product])<>Blank(), Calcuate(sum([Revenue_Euro]), filter(allselected(table), [sales_acct_unit3]=Max([sales_acct_unit3]))))


    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.