当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 糟糕,系统又被攻击了
- M 端软件产品设计思虑札记 - 知乎
- C expression tree (1)
- Tiktok live monitoring Api: random recommendation
- IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
- Cloud alibabab notes come out, the whole network detailed explanation only this one hand is slow
- python_ scrapy_ Fang Tianxia
- nvm
- Qt混合Python开发技术:Python介绍、混合过程和Demo
- GET,POST,PUT,DELETE,OPTIONS用法与说明
猜你喜欢

FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem

Littlest jupyterhub| 02 using nbgitpuller to distribute shared files

C language I blog assignment 03

What details does C + + improve on the basis of C

蓝牙2.4G产品日本MIC认证的测试要求

麦格理银行借助DataStax Enterprise (DSE) 驱动数字化转型

Simple use of future in Scala

Which is more worth starting with the difference between vivos7e and vivos7

1.深入Istio:Sidecar自动注入如何实现的?

数据科学面试应关注的6个要点
随机推荐
Brief history of computer
C language I blog assignment 03
0.计算机简史
Tiktok live monitoring Api: random recommendation
Simple use of future in Scala
UCGUI简介
FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem
ASP.NET MVC下基于异常处理的完整解决方案
游戏优化性能杂谈(十一) - 知乎
NOIP 2012 提高组 复赛 第一天 第二题 国王游戏 game 数学推导 AC代码(高精度 低精度 乘 除 比较)+60代码(long long)+20分代码(全排列+深搜dfs)
Is blazor ready to serve the enterprise?
PerconaXtraDBCluster8.0 最详尽用法指南
nvm
FORTRAN77从文件中读入若干数据并用heron迭代公式开方
C语言I博客作业03
The software in your host has terminated an established connection. resolvent
5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
python_ scrapy_ Fang Tianxia
2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
Solve the problem of rabbitmq message loss and repeated consumption