Tags
Advanced DAX interview questions, Advanced DAX Queries, Advanced DAX tutorial, Advanced DAX tutorial pdf, Analysis Services, Context in DAX, Data Analysis Expressions, DAX, DAX Common Interview Questions, DAX Common Interview Questions and answers, DAX FAQ, DAX FAQs, DAX Formatter, DAX Formatter by Vikas & Pawan, DAX Interview Q & A, DAX Interview questions, DAX Microsoft, DAX Parameter Replacer, DAX Patters, DAX Programming, DAX Queries asked in interviews, DAX questions, DAX Server, DAX Server - General Interview Questions and Answers, DAX Server developer Interview questions and answers, DAX Server developer Interview questions with answers, DAX SERVER Interview questions, DAX SERVER Interview questions & Answers, DAX SERVER Interview questions and Answers, DAX Server Interview Questions and Answers - Free PDF, DAX SERVER Interview questions and answers for experienced, DAX server interview questions and answers for net developers, DAX SERVER Interview questions for experienced, DAX SERVER Interview questions pdf, DAX SERVER Tips, DAX SERVER Tricky questions, DAX SSAS, DAX Tabular, DAX Tips & Tricks, DAX Tips and Tricks, DAX Tools, DAX Tricks, DAX Tricky Question, DAX Tutorial, DAX Utility, DAX with Tabular Model Series | How to find multiple strings in a tabular table using DAX?, Difficult DAX Interview Questions, Download DAX Interview Questions, Download DAX Questions, Download DAX Server Interview Question in PDF, Download DAX SERVER Interview questions, download DAX server interview questions and answers, download DAX server interview questions and answers pdf, download DAX server interview questions by Pawan Khowal, download DAX server interview questions by Pawan Kumar, download DAX server interview questions by Pawan Kumar Khowal, Dynamic Analysis Expressions, Filter DAX, Filter in DAX, FORMAT DAX, FORMAT DAX AND MDX, Format DAXMDX, Format MDX AND DAX, Format MDXDAX, Free Download DAX SERVER Interview questions, How to find multiple strings in a tabular table using DAX?, Interview Qs.SQL SERVER Questions, Interview Questions on SQL, InterviewQuestions, InterviewQuestions for SQL, Queries for SQL Interview, Tabular Model, Tool for DAX, Tools for DAX and Tabular Developers, TOP 100 DAX SERVER INTERVIEW QUESTIONS, Top 50 DAX Server Questions & Answers, Tough DAX Interview Questions, Tough DAX Queries, Tough DAX Queries Interview Questions, Tough DAX Questions, Tough PL DAX Interview Questions, Tricky DAX Interview Questions, Tricky DAX Interview Questions and answers, Tricky DAX Queries for Interview, Tricky DAX SERVER Interview Questions and answers, What is context in DAX, What is DAX?
DAX with Tabular Model Series | How to find multiple string in a tabular table using DAX?
Today let’s discuss how we can find multiple strings in a tabular model using DAX language. For this we need to use FIND function with CalculateTable or || with Filter. Well both filter and calculateTable are used like where clause in SQL Server. Now lets go through an example to discuss the same in more detail
-- EVALUATE ( CALCULATETABLE( SUMMARIZE ( InternetSales, InternetSales[Types], InternetSales[Description] ), InternetSales[ClientId] = 124090 ,Month[Month] >= DateValue("01/01/2012") ,Find ( "," & InternetSales[Description] & "," , ",Area Light,Cable Charges,Cable One Time Chg,Charitable Donation,", 1, - 1 ) > - 1 ) ) --

Pawan Khowal – DAX with Tabular Model Series – Find multiple string in a Tabular Table using DAX language
Ok so in the above example we are selecting types and description column from Internet Sales table. Please note that we are selecting distinct data only. Basically Summarize works like that. It will always gives distinct values. Calculate table is used to filter out things like where clause works in SQL Server. Here we have applied multiple filters.
Now point to be noted is how Filter function os used to find multiple strings from a single description column. Here we will get all the rows where column value matches with any of the value given in the string.
Now let’s consider one more query where we are finding multiple strings
-- EVALUATE ( SUMMARIZE( Calculatetable ( InternetSales ,InternetSales[ClientKey] = 124090 , Month[Month] >= DateValue("01/01/2006") , FILTER ( InternetSales, InternetSales[Description] ="Elec Adjustment" || InternetSales[Description] ="Elec Off Peak" || InternetSales[Description] ="Demand Off Peak" || InternetSales[Description] ="Elec Partial Pk" || InternetSales[Description] ="Dmd Partial Pk" || InternetSales[Description] ="Garbage/yards" || InternetSales[Description] ="Cust Chrg Water" ) ) ,InternetSales[Types] ,InternetSales[Description] ) ) --
In the above query we are using Filter function with Or condition to find out multiple strings.
The second option of using Filter function with || condition to find out multiple strings is more efficient in terms of performance. It is more scalable and takes very less time to get the data.
DAX is somewhat different when it comes to understanding how the things are executed and the execution plan. I will try to cover things slowly so that people can understand DAX complexity easily.
Thanks for reading
-Pawan Khowal
MSBISkills.com
You must be logged in to post a comment.