Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Create a new column based on multiple row values

I have a table called Sales that includes the following columns: Year Country Service Vendor Revenue I want to create a new column AllRevenue that filters the Sales table on the current row v...
  • Jihwan_Kim's avatar
    5 years ago

    Hi, Anonymous 

    I tried to create a sample pbix file based on your explanation.

    Please check the below picture and the link down below.

    I suggest creating a new measure, but since your request is creating a new column, the below formula is for creating a new column.

     

     

    ALL Rev CC =
    VAR currentyear = 'Table'[Year]
    VAR currentcountry = 'Table'[Country]
    VAR currentservice = 'Table'[Service]
    RETURN
    CALCULATE (
    SUM ( 'Table'[Revenue] ),
    FILTER (
    'Table',
    'Table'[Year] = currentyear
    && 'Table'[Country] = currentcountry
    && 'Table'[Service] = currentservice
    )
    )
     
    And for your reference, the below is a new measure.
     
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM