当前位置:网站首页>Function periodic table filter value selectedvalue
Function periodic table filter value selectedvalue
2020-11-08 08:54:00 【osc_gp8avable】
SELECTEDVALUE function
SELECTEDVALUE Function belongs to “ Screening ” Class function , Affiliated to the “ Table function ”.
Microsoft's official profile says this :
When the specified column has only one unique value in the current context , Returns the value ;
Otherwise, the replacement result is returned , Omit and return null value ;
In fact, according to the understanding of white tea , To put it more generally , It is to match the relevant values according to the current context .
purpose : Usually used in measures , Get external filter .
grammar
DAX=
SELECTEDVALUE(< Column >[, < Standby value >])
Parameters
Column : Fix existing columns , It can't be an expression ;
Standby value : optional , If the first parameter context is null , Or when there are multiple duplicate values , Return the standby value ; By default, the returned result is blank .
Return results
value
Example
Analog data :

Example 1:
SELECTEDVALUE Example 1 =
SELECTEDVALUE ( ' Example '[ Group ], FALSE () )
result :

As can be seen from the figure above , At present [ Category ] In the context of , Only a fraction of [ Group ] It's a non repeating unique value , So return the correct result , Other return FALSE.
Change the current context , Let's compare :

take [ Group ] As the current context , You can see that each category returns the correct value , Only the total column context is empty , return FALSE.
The effect is , Equivalent to the following code :
Equivalent code =
IF ( HASONEVALUE ( ' Example '[ Group ] ), VALUES ( ' Example '[ Group ] ), FALSE () )
Comparing the results :

The effect is equivalent to , however SELECTEDVALUE It is more concise and clear .
Example 2: Used to switch dynamic data .
This usage is well known to us , It is also a frequently used usage .
It can be used to switch data dynamically .
SELECTEDVALUE Example 2 =
SWITCH (
TRUE (),
SELECTEDVALUE ( ' Financial dimension '[ Financial dimension ] ) = " profits ", [ profits ],
SELECTEDVALUE ( ' Financial dimension '[ Financial dimension ] ) = " Sales amount ", [ Sales amount ],
BLANK ()
)
Specific case articles , White tea has been written for many times , I won't repeat it here , Interested partners can click to view .
Portal :
PowerBI White tea : Sales demand dynamic data zhuanlan.zhihu.com
friends GET Why? ?
White tea will share some function cards from time to time
( Documents on the planet of knowledge [PowerBI The demand circle ])

This is white tea , One PowerBI Beginners .

版权声明
本文为[osc_gp8avable]所创,转载请带上原文链接,感谢
边栏推荐
- 个人短网址生成平台 自定义域名、开启防红、统计访问量
- Codeforce算法题 | 你能想出解法,让你的基友少氪金吗?
- 架构师(2020年11月)
- PerconaXtraDBCluster8.0 最详尽用法指南
- How does spotify drive data-driven decision making?
- sed之查找替换
- What? Your computer is too bad? You can handle these moves! (win10 optimization tutorial)
- 0.计算机简史
- Brief history of computer
- Python learning Day1 -- Basic Learning
猜你喜欢
搜索引擎的日常挑战_4_外部异构资源 - 知乎
i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好
【原创】关于高版本poi autoSizeColumn方法异常的情况
分布式共识机制
What? Your computer is too bad? You can handle these moves! (win10 optimization tutorial)
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
PX4添加新的应用
个人短网址生成平台 自定义域名、开启防红、统计访问量
Unparseable date: 'Mon Aug 15 11:24:39 CST 2016',时间格式转换异常
架构师(2020年11月)
随机推荐
Brief history of computer
Deeplight Technology Bluetooth protocol SRRC certification services
Review the cloud computing application scenarios you didn't expect (Part 1)
More than 50 object detection datasets from different industries
Visual Studio 2015 未响应/已停止工作的问题解决
shiyou的数值分析作业
0.计算机简史
vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
Fgagt: flow guided adaptive graph tracking
Mouse small hand
Codeforce算法题 | 你能想出解法,让你的基友少氪金吗?
异常+abstract
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
print( 'Hello,NumPy!' )
The difference between vivoy 73s and glory 30 Youth Edition
抖音直播监控Api:随机推荐
Shiyou's numerical analysis assignment
IOS upload app store error: this action cannot be completed - 22421 solution
Template linked list learning
The most detailed usage guide for perconaxtradbcluster8.0