簡體   English   中英

用於過濾的 Power BI 代碼。 M語言調試代碼(在Power BI中創建列)

[英]Power BI Code for filtering. Debugging Codes in M language ( Creating a column in Power BI)

我有錯誤請你幫忙,因為我是新來的

= Table.AddColumn(#"Changed Type", "Custom", each if ([Application Name] = "BBK" and (Text.Contains([Entitlement Key], "_ADMIN_BBK") or Text.Contains([Entitlement Key] , "_UPDATE_BBK") 或 Text.Contains([Entitlement Key], "_READ_BBK")) then "YES" else if [Application Name] = "CBJ" and (Text.Contains([Entitlement Key], "_ADMIN_CBJ") 或Text.Contains([Entitlement Key],"_UPDATE_CBJ") or Text.Contains([Entitlement Key],"_EXECUTE_CBJ") or Text.Contains([Entitlement Key],"_READ_CBJ")) then "YES" else if [Application Name] = "NEX" and Text.Contains([Entitlement Key], "_READ_NEX") then "YES" else if [Application Name] = "SNR" and Text.Contains([Entitlement Key], "_READ_SNR" ) then "是”否則“否”))))

很難說你在做什么,但試試

= Table.AddColumn(#"Changed Type", "Custom", each 

if (
[Application Name] = "BBK" and (Text.Contains([Entitlement Key], "_ADMIN_BBK") or Text.Contains([Entitlement Key], "_UPDATE_BBK") or Text.Contains([Entitlement Key], "_READ_BBK"))) then "YES"
else if ([Application Name] = "CBJ" and (Text.Contains([Entitlement Key], "_ADMIN_CBJ") or Text.Contains([Entitlement Key],"_UPDATE_CBJ") or Text.Contains([Entitlement Key],"_EXECUTE_CBJ") or Text.Contains([Entitlement Key],"_READ_CBJ"))) then "YES"
else if [Application Name] = "NEX" and Text.Contains([Entitlement Key], "_READ_NEX") then "YES"
else if [Application Name] = "SNR" and Text.Contains([Entitlement Key], "_READ_SNR" ) then "YES"
else "NO"
)

我做了你應該做的 - 逐個嘗試,確保在添加下一行之前評估每一行。 某些地方的括號太少,而其他地方的括號太多

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM