50、Power Query-Text.Contains的学习
比如現(xiàn)在有這樣一個需求,需要篩選某列規(guī)格里面的一些內容。
比如我們要篩選出包含“110”以及“123”以及“CF”的規(guī)格,當然用條件格式也是可以的。
若是兩個包含,我們可以直接篩選得到,如下圖操作。
沒錯,就是文本篩選器里面的“包含”。
那么最后一個條件該如何引入呢?
我們不妨直接看它生成的公式,是不是豁然開朗?
= Table.SelectRows(更改的類型, each Text.Contains([型號], "110") or Text.Contains([型號], "123"))
直接添加"OR"即可。
= Table.SelectRows(更改的類型, each Text.Contains([型號], "110") or Text.Contains([型號], "123") or Text.Contains([型號], "CF"))
那么我們就來看看這個好用的Text.Contains()函數(shù)。
This topic applies to the Power Query Formula Language which can be used with?Power Query?and?Power BI Desktop?to build queries that mashup data. See the list of?function categories.
Returns true if a text value?substring?was found within a text value?string; otherwise, false.
Text.Contains(string as nullable text, substring as text, optional comparer as nullable function) as nullable logical| string | The text to parse. |
| substring | The text to search for. |
| optional comparer | The optional culture aware comparer function can be provided. |
清楚了這個函數(shù)的用法,當然“開頭為”和“結束為”也大同小異啦。
Text.StartsWith()
Text.EndsWith()
總結
以上是生活随笔為你收集整理的50、Power Query-Text.Contains的学习的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DAX 语法规范
- 下一篇: SAP BPC系统架构