Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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.

3 ACCEPTED SOLUTIONS
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous, 

 

You can create a measure below: 

 

Measure = SUMX(FILTER(ALL('Table'),SEARCH("ABC",'Table'[Movie],1,0)>0),'Table'[TicketCharge])
 
a2.PNG
 
Best Regards,
Qiuyun Yu
Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

amitchandak
Super User
Super User

@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)

 

View solution in original post

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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@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
Community Support
Community Support

Hi @Anonymous, 

 

You can create a measure below: 

 

Measure = SUMX(FILTER(ALL('Table'),SEARCH("ABC",'Table'[Movie],1,0)>0),'Table'[TicketCharge])
 
a2.PNG
 
Best Regards,
Qiuyun Yu
Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Anonymous
Not applicable

Thanks @shameeralikvqa 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.