当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- The difference between vivoy 73s and glory 30 Youth Edition
- Game mathematical derivation AC code (high precision and low precision multiplication and division comparison) + 60 code (long long) + 20 point code (Full Permutation + deep search DFS)
- Littlest JupyterHub| 02 使用nbgitpuller分发共享文件
- shiyou的数值分析作业
- 计算机网络基本概念(五)局域网基本原理
- FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem
- PX4添加新的应用
- 盘点那些你没想到的云计算应用场景(上)
- 5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
- QT hybrid Python development technology: Python introduction, hybrid process and demo
猜你喜欢

将“光头”识别为“足球”,AI 摄像头如何犯的错?

python_ scrapy_ Fang Tianxia

0.计算机简史

Unparseable date: 'Mon Aug 15 11:24:39 CST 2016',时间格式转换异常

Unparseable date: 'mon Aug 15 11:24:39 CST 2016', time format conversion exception

Shiyou's numerical analysis assignment

Wechat nickname Emoji expression, special expression causes the list not to be displayed, export excel error report and other problems solved!

游戏优化性能杂谈(十一) - 知乎

Improvement of rate limit for laravel8 update

i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好
随机推荐
python_ scrapy_ Fang Tianxia
Template linked list learning
What details does C + + improve on the basis of C
nvm
Test requirements for MIC certification of Bluetooth 2.4G products in Japan
Macquarie Bank drives digital transformation with datastex enterprise (DSE)
分布式共识机制
Julia 是如何风靡起来的?
SQL Server 2008R2 18456错误解决方案
接口
5G+AR出圈,中国移动咪咕成第33届中国电影金鸡奖全程战略合作伙伴
C/C++编程笔记:C语言相比其他编程语言,有什么不一样的优势?
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
Mate 40 series launch with Huawei sports health service to bring healthy digital life
QT hybrid Python development technology: Python introduction, hybrid process and demo
解决Safari浏览器下载文件文件名称乱码的问题
阅读心得:FGAGT: Flow-Guided Adaptive Graph Tracking
FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem
[original] about the abnormal situation of high version poi autosizecolumn method
Fgagt: flow guided adaptive graph tracking