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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anmolgan
Post Prodigy
Post Prodigy

Search for starting 5 letters in a string DAX?

I want to search for first 5 letters of a given 20-30 letters string, if it matches then calculate the sales for those 5 letters how can I write this DAX measure?

1 ACCEPTED SOLUTION

@Anonymous @az38  Thanks for your answers but the below DAX helped me to get to what I required:

 

IMFKOBLECO=

CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(Mapping, Mapping[Sales Group]= "IMF"),

FILTER(ZSD_MAT_MARGIN_Q003, ZSD_MAT_MARGIN_Q003[Customer Group.Customer Group Level 01.Name]= "IMF OEM"),

FILTER(ZSD_MAT_MARGIN_Q003, FIND("KOBELCO", ZSD_MAT_MARGIN_Q003[Material.Material Level 01],,0 ) <>0))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

try the below:

 

Measure = CALCULATE(SUM('Table'[Value]), FILTER('Table', LEFT('Table'[Text],5) = "Test1"))

@Anonymous @az38  Thanks for your answers but the below DAX helped me to get to what I required:

 

IMFKOBLECO=

CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(Mapping, Mapping[Sales Group]= "IMF"),

FILTER(ZSD_MAT_MARGIN_Q003, ZSD_MAT_MARGIN_Q003[Customer Group.Customer Group Level 01.Name]= "IMF OEM"),

FILTER(ZSD_MAT_MARGIN_Q003, FIND("KOBELCO", ZSD_MAT_MARGIN_Q003[Material.Material Level 01],,0 ) <>0))
az38
Community Champion
Community Champion

Hi @Anmolgan 

see the LEFT function https://docs.microsoft.com/en-us/dax/left-function-dax

so, try something like this

=calculate(sum(Table[Sales]);Table[ColumnSearch]='abcdef')

  

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors