[英]How to filter existing measures created using DAX in Power BI?
I have created two measures我创建了两个措施
#SavingsLocal =
CALCULATE(
SUM('Savings'[sum(Risk Percentage*USLP Savings)]),
FILTER(ALL('Savings'),SEARCH("NO",'Savings'[ICB],,BLANK()) && SEARCH("YTD",'Savings'[Scenario],,BLANK())))
and和
#SavingsGlobal =
CALCULATE(
SUM('Savings'[sum(Risk Percentage*USLP Savings)]),
FILTER(ALL('Savings'),SEARCH("YES",'Savings'[ICB],,BLANK()) && SEARCH("YTD",'Savings'[Scenario],,BLANK())))
Now if my Region column present in the Savings Table is "GLOBAL", I want to use my #SavingsGlobal else #SavingsLocal现在,如果我在储蓄表中的区域列是“全球”,我想使用我的#SavingsGlobal else #SavingsLocal
I created a calculated column for this我为此创建了一个计算列
#finalsavings = IF(Savings[Location - Region (L1)] == "GLOBAL",Savings[#SavingsGlobal],Savings[#SavingsLocal])
but this does not seem to work at all, its giving me a value for Global but for others I am getting a same value.但这似乎根本不起作用,它给了我一个全球价值,但对其他人来说,我得到了同样的价值。
How do I approach this using DAX?我如何使用 DAX 来解决这个问题?
You can create a calculated measure that combines the two:您可以创建一个结合两者的计算量度:
#finalsavings =
IF(SELECTEDVALUE(Savings[Location - Region (L1)]) == "Global",
Savings[#SavingsGlobal],
Savings[#SavingsLocal])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.