当前位置:网站首页>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.comfriends 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]所创,转载请带上原文链接,感谢
边栏推荐
- QT hybrid Python development technology: Python introduction, hybrid process and demo
- China Telecom announces 5g SA commercial scale in 2020
- Astra: the future of Apache Cassandra is cloud native
- Macquarie Bank drives digital transformation with datastex enterprise (DSE)
- 2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
- 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)
- Summary of knowledge points of Jingtao project
- nvm
- 【总结系列】互联网服务端技术体系:高性能之数据库索引
- Which is more worth starting with the difference between vivos7e and vivos7
猜你喜欢
游戏优化性能杂谈(十一) - 知乎
python_ scrapy_ Fang Tianxia
Seven features of Python 3.9
Distributed consensus mechanism
Deeplight Technology Bluetooth protocol SRRC certification services
Learn Scala if Else statement
函数周期表丨筛选丨值丨SELECTEDVALUE - 知乎
scala 中 Future 的简单使用
Qt混合Python开发技术:Python介绍、混合过程和Demo
Visual Studio 2015 未响应/已停止工作的问题解决
随机推荐
模板链表类学习
Solve the problem of rabbitmq message loss and repeated consumption
Review the cloud computing application scenarios you didn't expect (Part 1)
Search and replace of sed
什么你的电脑太渣?这几招包你搞定! (Win10优化教程)
C language I blog assignment 03
print( 'Hello,NumPy!' )
软件测试就是这么回事?!
Cloud alibabab notes come out, the whole network detailed explanation only this one hand is slow
print( 'Hello,NumPy!' )
laravel8更新之速率限制改进
游戏优化性能杂谈(十一) - 知乎
Is blazor ready to serve the enterprise?
Littlest JupyterHub| 02 使用nbgitpuller分发共享文件
Tiktok live monitoring Api: random recommendation
IOS upload app store error: this action cannot be completed - 22421 solution
IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
归纳一些比较好用的函数
Wechat nickname Emoji expression, special expression causes the list not to be displayed, export excel error report and other problems solved!
i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好