如何解决这个度量计算中的性能问题?

huangapple go评论70阅读模式
英文:

How do I address performance issue in this measure calculation?

问题

金额(不包括管理费)=
如果(
或(
选择值(IMSEmployeeTimesheet[原始成本中心]) = "1000-92-00",
选择值(IMSEmployeeTimesheet[原始成本中心]) = "1000-09-00"
)
&&
NOT(USERPRINCIPALNAME()) IN {"c.hall@abc.com", "s.goss@abc.com", "n.cockroft@abc.com"},
空白(),
SUMX(IMSEmployeeTimesheet, IMSEmployeeTimesheet[金额])
)

英文:
 Amount (ex mgmt) = 
 IF(
     OR(
         SELECTEDVALUE(IMSEmployeeTimesheet[OriginalCostCentre]) = "1000-92-00", 
         SELECTEDVALUE(IMSEmployeeTimesheet[OriginalCostCentre]) = "1000-09-00"
        ) 
        && 
        NOT(USERPRINCIPALNAME()) IN {"c.hall@abc.com", "s.goss@abc.com", "n.cockroft@abc.com"},
     BLANK(),
     SUMX(IMSEmployeeTimesheet, IMSEmployeeTimesheet[Amount])
 )

The above measure is causing performance issues.

> More details: Resource Governing: This query uses more memory than the configured limit. The query — or calculations referenced by it — might be too memory-intensive to run. Either simplify the query or its calculations, or if using Power BI Premium, you may reach out to your capacity administrator to see if they can increase the per-query memory limit. More details: consumed memory 1331 MB, memory limit 1331 MB. Learn more, see https://go.microsoft.com/fwlink/?linkid=2159752.
Activity ID: 4c980721-99e3-4543-99fb-0b7db9cd9f7d
Correlation ID: e653bb76-ea95-b019-0e91-97893c535225
Request ID: 3c57fbc4-f3ac-4f84-9518-20d362d88df1
Time: Thu Jun 15 2023 11:07:42 GMT+1200 (New Zealand Standard Time)
Service version: 13.0.20866.74
Client version: 2306.1.14294-train
Cluster URI: https://wabi-australia-southeast-redirect.analysis.windows.net/

I am trying to hide management salaries without affecting the total from teams using the dashboard. Only a handful of people are allowed to view the salaries.

答案1

得分: 0

我会将这分为两部分:

Amount (ex mgmt) =
CALCULATE( SUM(IMSEmployeeTimesheet[Amount]),
NOT(IMSEmployeeTimesheet[OriginalCostCentre] IN {"1000-92-00","1000-09-00"}))

Amount (mgmt only) = IF(
USERPRINCIPALNAME() IN {"c.hall@abc.com", "s.goss@abc.com", "n.cockroft@abc.com"},
CALCULATE( SUM(IMSEmployeeTimesheet[Amount]),
IMSEmployeeTimesheet[OriginalCostCentre] IN {"1000-92-00","1000-09-00"}),BLANK())

然后你可以创建一个总数,是这两者的和。但请记住,如果给用户访问编辑PowerBI报告的权限,工资仍然会存在于模型中并对所有人可见。要进行控制,你需要一些行级安全性规则。

英文:

I would split this into two:

Amount (ex mgmt) = 
 CALCULATE( SUM(IMSEmployeeTimesheet[Amount]),
    NOT(IMSEmployeeTimesheet[OriginalCostCentre] IN {"1000-92-00","1000-09-00"}))

Amount (mgmt only) = IF( 
   USERPRINCIPALNAME() IN {"c.hall@abc.com", "s.goss@abc.com", "n.cockroft@abc.com"},
   CALCULATE( SUM(IMSEmployeeTimesheet[Amount]),
        IMSEmployeeTimesheet[OriginalCostCentre] IN {"1000-92-00","1000-09-00"}),BLANK())

Then you can create a total which is the sum of both. But remember the salaries are still in the model and visible to everyone, if you give the users access to edit the powerbi report. To have this controlled you would need some sort of Row Level Security rule.

huangapple
  • 本文由 发表于 2023年6月15日 07:11:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76478124.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定