当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- C / C + + Programming Notes: what are the advantages of C compared with other programming languages?
- An error occurred while starting the kernel was successfully resolved
- M 端软件产品设计思虑札记 - 知乎
- 【总结系列】互联网服务端技术体系:高性能之数据库索引
- nvm
- 高并发,你真的理解透彻了吗?
- python学习 day1——基础学习
- 解决Safari浏览器下载文件文件名称乱码的问题
- 哔哩哔哩常用api
- NOIP 2012 提高组 复赛 第一天 第二题 国王游戏 game 数学推导 AC代码(高精度 低精度 乘 除 比较)+60代码(long long)+20分代码(全排列+深搜dfs)
猜你喜欢
0.计算机简史
软件测试就是这么回事?!
SQL Server 2008R2 18456错误解决方案
技术人员该如何接手一个复杂的系统?
The real-time display of CPU and memory utilization rate by Ubuntu
Mate 40 series launch with Huawei sports health service to bring healthy digital life
C language I blog assignment 03
Littlest jupyterhub| 02 using nbgitpuller to distribute shared files
双向LSTM在时间序列异常值检测的应用
什么你的电脑太渣?这几招包你搞定! (Win10优化教程)
随机推荐
C expression tree (1)
What details does C + + improve on the basis of C
Which is more worth starting with the difference between vivos7e and vivos7
C/C++编程笔记:C语言相比其他编程语言,有什么不一样的优势?
Codeforce算法题 | 你能想出解法,让你的基友少氪金吗?
scala 中 Future 的简单使用
Mate 40系列发布 搭载华为运动健康服务带来健康数字生活
Shiyou's numerical analysis assignment
计算机网络基本概念(五)局域网基本原理
FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem
5g/4g工业无线路由器
搜索引擎的日常挑战_4_外部异构资源 - 知乎
vivoS7e和vivoS7的区别 哪个更值得入手
How did Julia become popular?
SQL Server 2008R2 18456 error resolution
QT hybrid Python development technology: Python introduction, hybrid process and demo
What? Your computer is too bad? You can handle these moves! (win10 optimization tutorial)
VC6兼容性及打开文件崩溃问题解决
More than 50 object detection datasets from different industries
Bili Bili common API