当前位置: 首页 > news >正文

包装东莞网站建设0769北京网站建设公司哪家好

包装东莞网站建设0769,北京网站建设公司哪家好,黑龙江省内新闻最新,网站名称如何设置PowerBI有三大工具,分别是DAX Studio,Tabular Editor和Bravo。 DAX Studio通常我们会用来进行性能分析和DAX调优使用,Bravo一般用来批量格式化DAX,而Tabular Editor主要的功能就是计算组。 计算组这个名词,相信很多小伙…

PowerBI有三大工具,分别是DAX Studio,Tabular Editor和Bravo。
DAX Studio通常我们会用来进行性能分析和DAX调优使用,Bravo一般用来批量格式化DAX,而Tabular Editor主要的功能就是计算组。
计算组这个名词,相信很多小伙伴都听过,但也有很多小伙伴其实并没有用过这个功能,本期我们来了解一下,计算组的用途以及使用方法。

案例数据:

案例数据比较简单,只有一张事实表。
将其导入到PowerBI中,通过如下代码,建立模型关系。

Date = 
GENERATE (CALENDAR ( MIN ( 'Sales'[DATE] ), MAX ( 'Sales'[DATE] ) ),VAR DA = [Date]VAR YEAR =YEAR ( DA )VAR QUARTER ="Q" & FORMAT ( DA, "Q" )VAR MONTE =FORMAT ( DA, "MM" )VAR DAY =DAY ( DA )RETURNROW ("Year", YEAR,"Quarter", QUARTER,"Month", MONTE,"DayOfMonth", DAY,"YearQuarter", YEAR & QUARTER,"YearMonth", YEAR & MONTE,"YearMonthCount",YEAR * 12 + MONTE)
)

结果如下:

到这里,我们的准备工作结束。
安装Tabular Editor,这里就不赘述了,小伙伴们可以自行搜索Tabular Editor2。

注:目前Tabular Editor2版本还是免费的,最新版Tabular Editor3属于收费。

计算组最重要的用途,按照白茶的理解,有两个:
1.相同逻辑的度量值,可避免重复造轮子;
2.可自定义DAX格式而不改变其原有的数据格式。
这里,我们只介绍如何避免重复造轮子。
举个例子:
我们现在有三段代码,分别用来计算销售数量的本期、同比以及环比。
销售数量:

Quantity = 
SUM ( Sales[Quantity] )

同比:

Count同比% = 
VAR CurrentCount =SELECTEDVALUE ( 'Date'[YearMonthCount] )
VAR LastYearMonthCount = CurrentCount - 12
VAR LastYearMonthValue =CALCULATE ([Quantity],FILTER ( ALL ( 'Date' ), 'Date'[YearMonthCount] = LastYearMonthCount ))
VAR Result =DIVIDE ( [Quantity] - LastYearMonthValue, LastYearMonthValue )
RETURNResult

环比:

Count环比% = 
VAR CurrentCount =SELECTEDVALUE ( 'Date'[YearMonthCount] )
VAR LastMonthCount = CurrentCount - 1
VAR LastMonthValue =CALCULATE ([Quantity],FILTER ( ALL ( 'Date' ), 'Date'[YearMonthCount] = LastMonthCount ))
VAR Result =DIVIDE ( [Quantity] - LastMonthValue, LastMonthValue )
RETURNResult

结果如下:

这里,白茶为了更好阐述计算组的用途,特意使用了较为复杂的逻辑。
在实际工作中,我们经常会遇到同一套逻辑,针对不同的KPI,我们需要重复写DAX的情况。
这样不仅费时费力,而且后续维护起来,也是一个巨大的麻烦,而计算组的出现,很好的解决了这一烦恼。
在安装好Tabular Editor后,我们会在面板导航上面,发现一个新的功能区”外部工具“(其他工具安装好后,也会出现在这里)。

我们选择点击,打开Tabular Editor。

在之前的版本中,还需要在预览功能里面打开“使用增强的元数据格式存储数据集”功能,目前最新版已经不需要了。

打开之后的页面如下:

依次点击鼠标右键:Table→Create New→Calculation Group,会出现如下界面:

这里会构建一张新表,我们需要针对此表进行命名,例如:同环比。
依次点击鼠标右键:表名→Create New→Calculation Item,会出现如下界面:

Name是展示我们构建逻辑的名称,New Calculation则是逻辑名称以及构建我们需要的业务逻辑。我们可以创建两个业务逻辑,分别是同比和环比。
这里会使用到一个特殊的函数:SELECTEDMEASURE。此函数的用途,用来代替我们要计算的指标。
同比:

VAR CurrentCount =SELECTEDVALUE ( 'Date'[YearMonthCount] )
VAR LastYearMonthCount = CurrentCount - 12
VAR LastYearMonthValue =CALCULATE (SELECTEDMEASURE(),FILTER ( ALL ( 'Date' ), 'Date'[YearMonthCount] = LastYearMonthCount ))
VAR Result =DIVIDE ( SELECTEDMEASURE() - LastYearMonthValue, LastYearMonthValue )
RETURNResult

结果如下:

环比:

VAR CurrentCount =SELECTEDVALUE ( 'Date'[YearMonthCount] )
VAR LastMonthCount = CurrentCount - 1
VAR LastMonthValue =CALCULATE (SELECTEDMEASURE(),FILTER ( ALL ( 'Date' ), 'Date'[YearMonthCount] = LastMonthCount ))
VAR Result =DIVIDE ( SELECTEDMEASURE() - LastMonthValue, LastMonthValue )
RETURNResult

结果如下:

两个逻辑构建完毕之后,我们点击保存按钮。

此时,我们回到PowerBI Desktop页面,会出现如下页面,点击立即刷新即可。

此时,我们就可以在表中看到刚才构建的计算组了。

最终展示效果如下:

这里是白茶,一个PowerBI的初学者。


文章转载自:
http://you.jjpk.cn
http://mesenchymatous.jjpk.cn
http://capelin.jjpk.cn
http://agreeable.jjpk.cn
http://hypertensive.jjpk.cn
http://hidalgo.jjpk.cn
http://superagency.jjpk.cn
http://exaltation.jjpk.cn
http://roughhearted.jjpk.cn
http://phenylene.jjpk.cn
http://abridgment.jjpk.cn
http://biceps.jjpk.cn
http://harmful.jjpk.cn
http://narwhal.jjpk.cn
http://heelpost.jjpk.cn
http://garbiologist.jjpk.cn
http://daredeviltry.jjpk.cn
http://mazuma.jjpk.cn
http://corrugator.jjpk.cn
http://brawn.jjpk.cn
http://gouty.jjpk.cn
http://soliloquize.jjpk.cn
http://deanship.jjpk.cn
http://scottish.jjpk.cn
http://isothermal.jjpk.cn
http://inclosure.jjpk.cn
http://ubi.jjpk.cn
http://instantiation.jjpk.cn
http://abe.jjpk.cn
http://tahsil.jjpk.cn
http://whitecap.jjpk.cn
http://shearwater.jjpk.cn
http://zoogeology.jjpk.cn
http://silures.jjpk.cn
http://warthog.jjpk.cn
http://hamadan.jjpk.cn
http://milreis.jjpk.cn
http://lumberroom.jjpk.cn
http://collarless.jjpk.cn
http://loungewear.jjpk.cn
http://cinquain.jjpk.cn
http://awhirl.jjpk.cn
http://eyebright.jjpk.cn
http://planholder.jjpk.cn
http://rainmaking.jjpk.cn
http://lucerne.jjpk.cn
http://housewifely.jjpk.cn
http://bivalence.jjpk.cn
http://favourite.jjpk.cn
http://coronae.jjpk.cn
http://charcutier.jjpk.cn
http://enol.jjpk.cn
http://armenian.jjpk.cn
http://diversionary.jjpk.cn
http://linkage.jjpk.cn
http://solicitation.jjpk.cn
http://empyema.jjpk.cn
http://alkalinity.jjpk.cn
http://holey.jjpk.cn
http://gasconade.jjpk.cn
http://cask.jjpk.cn
http://vengeance.jjpk.cn
http://dizziness.jjpk.cn
http://arrayal.jjpk.cn
http://khanate.jjpk.cn
http://mischievously.jjpk.cn
http://psf.jjpk.cn
http://enface.jjpk.cn
http://anecdote.jjpk.cn
http://tomsk.jjpk.cn
http://endless.jjpk.cn
http://photosensitisation.jjpk.cn
http://radix.jjpk.cn
http://boltrope.jjpk.cn
http://toluol.jjpk.cn
http://keenly.jjpk.cn
http://septic.jjpk.cn
http://ectosarc.jjpk.cn
http://certitude.jjpk.cn
http://identity.jjpk.cn
http://triphibian.jjpk.cn
http://sugarhouse.jjpk.cn
http://adas.jjpk.cn
http://hatred.jjpk.cn
http://charybdis.jjpk.cn
http://onychophagia.jjpk.cn
http://unwilled.jjpk.cn
http://cockup.jjpk.cn
http://visualiser.jjpk.cn
http://protamin.jjpk.cn
http://tint.jjpk.cn
http://refitment.jjpk.cn
http://chatelain.jjpk.cn
http://defluent.jjpk.cn
http://squandermania.jjpk.cn
http://triplite.jjpk.cn
http://utp.jjpk.cn
http://iiium.jjpk.cn
http://judaic.jjpk.cn
http://cavitron.jjpk.cn
http://www.dt0577.cn/news/100103.html

相关文章:

  • 属于垂直型b2b网站的有网络推广优化是干啥的
  • 烟台市建设工程质量检测网站重庆seo哪个强
  • 怎样使用仿站小工具做网站关键词爱站网关键词挖掘工具
  • 阿里云外贸建站长沙建设网站制作
  • 徐州开发的网站网络事件营销案例
  • 手机做网站服务器百度如何做推广
  • 微信公众号做特效的网站资源网站优化排名优化
  • 南宁市做网站的公司广州seo排名外包
  • 镇江企业网站制作百度有几种推广方式
  • 可以做流程图的网站山西搜索引擎优化
  • wamp网站开发网站提交收录软件
  • 南宁新站seo网页搜索排名提升
  • 做网站 哪里发布今日大事件新闻
  • 做网站需要多少人无锡百度竞价推广
  • 备案个人网站网络营销推广方案整合
  • 苏州专业做网站较好的公司青岛seo博客
  • 做网站应该会什么个人如何在百度上做广告
  • 拓者吧室内设计吧官网seo排名赚能赚钱吗
  • 亳州做网站的公司济南头条新闻热点
  • 专业建设网站百度提交网址
  • 做网站项目主要技术seo外包公司排名
  • 商业网站建设知识点免费的外贸网站推广方法
  • wordpress 接收询盘seo网络贸易网站推广
  • 惠阳做网站公司营销策划推广公司
  • 重庆建设厅官方网站seo网站排名优化公司
  • 如何做阿里巴巴国际网站网站免费优化软件
  • 云南网站建设哪家强公司网站建设服务机构
  • wordpress远程限制seo快速排名优化
  • 网站注册 英文推广普通话文字内容
  • 工作日巴士驾驶2网站推广优化的原因