当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- nvm
- C++在C的基础上改进了哪些细节
- Goland 编写含有template的程序
- Swiper window width changes, page width height changes lead to automatic sliding solution
- Sum up some useful functions
- GoLand writes a program with template
- [original] about the abnormal situation of high version poi autosizecolumn method
- Adobe Prelude / PL 2020 software installation package (with installation tutorial)
- 异常+abstract
- 5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
猜你喜欢

Spotify是如何推动数据驱动决策的?

5g/4g工业无线路由器

sed之查找替换

QT hybrid Python development technology: Python introduction, hybrid process and demo

Fgagt: flow guided adaptive graph tracking

Test requirements for MIC certification of Bluetooth 2.4G products in Japan

Learn Scala if Else statement

SQL Server 2008R2 18456 error resolution

技术人员该如何接手一个复杂的系统?

i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好
随机推荐
Python3.9的7个特性
ubuntu实时显示cpu、内存占用率
解决RabbitMQ消息丢失与重复消费问题
Deeplight Technology Bluetooth protocol SRRC certification services
Adobe Prelude /Pl 2020软件安装包(附安装教程)
c# 表达式树(一)
Qt混合Python开发技术:Python介绍、混合过程和Demo
【总结系列】互联网服务端技术体系:高性能之数据库索引
Is blazor ready to serve the enterprise?
ASP.NET A complete solution based on exception handling in MVC
Introduction to ucgui
模板链表类学习
GET,POST,PUT,DELETE,OPTIONS用法与说明
i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
计算机网络基本概念(五)局域网基本原理
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)
Learn Scala if Else statement
Spotify是如何推动数据驱动决策的?
Do you really understand the high concurrency?