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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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