Filtering rows if the text (string) match in Dax

 In Power BI, you can filter rows in a table or dataset using Data Analysis Expressions (DAX) by creating measures or calculated columns that use the `FILTER` function to specify a condition for filtering rows based on a text (string) match.


Here's a basic example of how to filter rows in DAX when the text in a specific column matches a certain string:


Assuming you have a table named "YourTable" with a column named "YourColumn" that contains text:


```dax

FilteredTable =

FILTER (

    YourTable,

    YourTable[YourColumn] = "YourTargetText"

)

```


In this DAX code:


- `YourTable` is the name of your table.

- `YourColumn` is the name of the column that you want to match against the text.

- `"YourTargetText"` is the text you want to match.


The `FILTER` function returns a table that includes only the rows where the condition (`YourTable[YourColumn] = "YourTargetText"`) is met.


You can create a new measure or calculated column with this DAX code, and it will create a new table with the filtered rows. This new table can then be used in your Power BI reports.


Remember to adjust the table and column names as well as the target text to match your specific dataset and filtering criteria.

Comments

Popular posts from this blog

bad character U+002D '-' in my helm template

GitLab pipeline stopped working with invalid yaml error

How do I add a printer in OpenSUSE which is being shared by a CUPS print server?