Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Creating measure by adding column value

 

Hi All,

I have a dataset with values like below


ABCD Theatre 1 100
ABCE Theatre 2 300
ABCE Theatre 4 200
ABCD Theatre 3 150
GABC Theatre 1 120
PLK Theatre 2 100
ABCE Theatre 5 125

MovieTheatreTicketCharge
ABCDTheatre 1100
ABCETheatre 2300
ABCETheatre 3200
ABCDTheatre 4150
GABCTheatre 3120
PLKETheatre 4100
ABCETheatre 5125


I need to create a measure with sum of ticketcharge where movie name contains ABC with output ABC-1075
Need help for this.

I treid like below
MEASURE = SUMX('MOVIETABLE',FILTER('MOVIETABLE','MOVIETABLE'['Movie'] = 'ABC'),TicketCharge)

giving errors.

  • Hi Anonymous, 

     

    You can create a measure below: 

     

    Measure = SUMX(FILTER(ALL('Table'),SEARCH("ABC",'Table'[Movie],1,0)>0),'Table'[TicketCharge])
     
     
    Best Regards,
    Qiuyun Yu
  • Anonymous 

    If you need at the start

    MEASURE = SUMX('MOVIETABLE',FILTER('MOVIETABLE',left('MOVIETABLE'['Movie'],3) = "ABC"),TicketCharge)

     

    Anywhere in the string

    MEASURE = SUMX('MOVIETABLE',FILTER('MOVIETABLE',search("ABC",'MOVIETABLE'['Movie'],1,0)>0 ),TicketCharge)

     

  • SumABC = CALCULATE(SUM('Table'[TicketCharge]),FILTER('Table',FIND("ABC", 'Table'[Movie],,0)<>0))

4 Replies

  • Anonymous 

    If you need at the start

    MEASURE = SUMX('MOVIETABLE',FILTER('MOVIETABLE',left('MOVIETABLE'['Movie'],3) = "ABC"),TicketCharge)

     

    Anywhere in the string

    MEASURE = SUMX('MOVIETABLE',FILTER('MOVIETABLE',search("ABC",'MOVIETABLE'['Movie'],1,0)>0 ),TicketCharge)

     

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Community Support

    Hi Anonymous, 

     

    You can create a measure below: 

     

    Measure = SUMX(FILTER(ALL('Table'),SEARCH("ABC",'Table'[Movie],1,0)>0),'Table'[TicketCharge])
     
     
    Best Regards,
    Qiuyun Yu
    • shameeralikvqa's avatar
      shameeralikvqa
      New Member

      SumABC = CALCULATE(SUM('Table'[TicketCharge]),FILTER('Table',FIND("ABC", 'Table'[Movie],,0)<>0))