When I embarked on my Power BI journey I was almost immediately slapped with an onslaught of foreign and perplexing terms that all seemed to do similar, but somehow different, things.

当我开始Power BI之旅时,我几乎立刻受到了外国和困惑术语的冲击,这些术语似乎都在做着相似但有所不同的事情。

There is a language called M but there is also a language called DAX? What is the difference between a calculated column and a measure? When should I be using Power Query?

T 这里是一种叫做M的语言,但也有一种叫做DAX的语言? 计算列和度量之间有什么区别? 什么时候应该使用Power Query?

Photo by Daniel Jensen on Unsplash
Daniel Jensen在Unsplash上拍摄的照片

I got stuck really early in my journey trying (and failing) to understand some key concepts that made Power BI seem much more difficult and confusing than it is. I almost abandoned my BI ambitions to crawl back to my familiar pal, Excel. Better the devil you know, right? WRONG!

我在尝试(失败)尝试的过程中很早就陷入了困境,并且未能理解一些使Power BI看起来比实际困难和混乱的关键概念。 我几乎放弃了我的BI野心,回到了我熟悉的朋友Excel。 更好的恶魔,对吗? 错误!

I am so, so, SO happy that I kept banging my head against the wall to get over those initial hurdles. Today, I use Power BI almost daily, and I use it cheerfully, gleefully even, and I rarely use Excel. But getting here was hard, really hard. And it was harder than it should have been because, for a long time, I did not have a clear, conceptual understanding of some key Power BI concepts.

我是如此,如此,如此高兴,我一直将头撞在墙上以克服那些最初的障碍。 今天,我几乎每天都在使用Power BI,并且愉快,愉快使用它,而我很少使用Excel。 但是到这里很难,真的很难。 而且这比原本应该的困难,因为很长一段时间以来,我对某些关键的Power BI概念没有清晰的概念性理解。

I am going to try to keep things as simple as possible to give you just a hint, a tinge, a taste to get you started.

我将尝试使事情尽可能简单,以便给您一个提示淡淡色彩和使您入门的品味

More experienced Power BI users might cringe at the way I am (over) simplifying and reducing these concepts, but you know what? At this point, all of the nuance and minutia really doesn’t matter. You need a place to start. Trust me, the complexity will come.

经验丰富的Power BI用户可能会对我简化和减少这些概念的方式感到畏缩,但是您知道吗? 在这一点上,所有细微差别和细节都不重要。 您需要一个起点。 相信我,复杂性将会到来。

So, my intrepid warrior, my Padawan, my Power BI master-to-be, here is a very basic overview of:

因此,我的勇敢勇士,Padawan和Power BI未来的主人,这里是以下内容的非常基本的概述:

  1. Power Query and M

    功率查询和M

  2. DAX

    达克斯

  3. Calculated Column and Measures

    计算列和度量

  4. Power Query vs. DAX

    电源查询与DAX

Photo by NeONBRAND on Unsplash
NeONBRAND在Unsplash上拍摄的照片

功率查询和M (Power Query and M)

What the heck is it? This is where it all begins. Power Query is where you pull your data into Power BI. M is the coding language used by Powery Query. You can use Power Query by pointing and clicking and the code in M will essentially be created for you. You can also write your own code in M directly.

这到底是什么? 这就是一切的开始。 Power Query是将数据拉入Power BI的地方。 M是Powery Query使用的编码语言。 您可以通过指向和单击来使用Power Query,M中的代码实际上将为您创建。 您也可以直接在M中编写自己的代码。

When do I use it? To clean and format your data. You can do things like remove and add columns, filter out data, change column formatting, etc.

什么时候使用? 清理和格式化数据。 您可以执行删除和添加列,过滤数据,更改列格式等操作。

Do I have to use M?: Short answer, no. You can do most things in Power Query by pointing and clicking without needing to use M at all. However, knowing M can be really helpful in making your process more flexible and easier to replicate in the future. For example, when using M you can copy and paste bits of code you want to reuse and you can annotate your steps.

我必须使用M吗? :简短回答,不。 您可以通过指向和单击来执行Power Query中的大多数操作,而根本不需要使用M。 但是,了解M确实可以使您的过程更灵活,将来更容易复制。 例如,使用M时,您可以复制和粘贴要重用的代码位,并可以注释步骤。

Tip for learning: Do what you need to in Power Query by pointing and clicking and then open the Advanced Editor. The M code will be there for the manipulations you have just completed. This way, you can start to get familiar with the language and by making small tweaks before you try writing your own M code from scratch.

学习提示 :指向并单击,然后打开“ 高级编辑器” ,即可执行Power Query中需要执行的操作 M代码将在其中用于您刚刚完成的操作。 这样,在尝试从头开始编写自己的M代码之前,您可以进行一些细微的调整,从而开始熟悉该语言。

达克斯 (DAX)

What the heck is it? DAX, short for Data Analysis eXpressions, can be used to create measures and calculated columns once your data has been pulled into Power BI with Power Query/M.

这到底是什么? DAX是Data Analysis eXpressions(数据分析表达式)的缩写,一旦将数据通过Power Query / M导入到Power BI中,即可用于创建度量和计算列。

When do I use it?: Using DAX is essentially like using formulas in Excel — it allows you to make calculations based on your data. You can use DAX to create calculated columns or measures.

我什么时候使用它?:使用DAX本质上类似于在Excel中使用公式-它使您可以根据数据进行计算。 您可以使用DAX创建计算列或度量。

计算列和度量 (Calculated Columns and Measures)

What the heck is it? Calculated columns and measures are two ways to write expressions in DAX. A calculated column will create an additional column with a value for every row in your table. A measure is an aggregate expression based on multiple rows in a table or multiple tables.

这到底是什么? 计算列和度量是在DAX中编写表达式的两种方法。 计算列将创建一个附加列,该附加列为表中的每一行提供一个值。 度量是基于一个表或多个表中的多行的聚合表达式。

When should I do a measure vs. a calculated column? I am so glad you asked because I really struggled with this one. This is a tricky one because you often can use either a measure or a calculated column (but that doesn’t mean you should).

什么时候应该进行度量与计算列比较? 您问我很高兴,因为我真的很努力。 这是一个棘手的问题,因为您经常可以使用度量或计算列(但这并不意味着您应该使用)。

Things to keep in mind with measures and calculated columns:

度量和计算列要记住的事情:

  • When you can use either, use a measure

    当你可以使用,使用措施

  • A calculated column is typically used when you want to use it as a filter or slicer or if you want to create categories (e.g. add a column that has “New Employee,” “Employee”, or “Senior Employee” based on their tenure).

    当您想将其用作过滤器或切片器或要创建类别时,通常使用计算列 (例如,根据其任期添加具有“新雇员”,“雇员”或“高级雇员”的列) 。

  • You have to use a measure if you want to calculate something based on what the user has selected (e.g. calculating the total revenue for a department selected in a slicer)

    如果要基于用户选择的内容进行计算,则必须使用度量 (例如,计算在切片器中选择的部门的总收入)

If the distinction between calculated columns and measures doesn’t totally make sense right now, that is okay. Try experimenting with creating both a measure and a calculated column and see if they both do what you need them to. If they do, great, use the measure. If just the calculated column works, go with that!

如果现在对计算列和度量之间的区别还不完全了解,那就可以了。 尝试同时创建度量和计算列,以查看它们是否都满足您的要求。 如果可以,那么请使用该措施。 如果只是计算出的列有效,那就继续吧!

功率查询(M)或DAX? (Power Query (M) or DAX?)

Things got confusing for me here, too, because it seemed like most of what I could do in Power Query/M, I could also do in DAX. Which one am I supposed to use and when?

这里的事情也让我感到困惑,因为这似乎是我在Power Query / M中可以做的大多数事情,在DAX中也可以做到。 我应该使用哪一个?何时使用?

Short answer: Use Power Query/M when possible. (The big exception here is if you are trying to create a calculated column that references a column in a different table. In that case, use DAX to create a calculated column)

简短答案 :尽可能使用Power Query / M。 (这里的最大例外是,如果您尝试创建引用不同表中的列的计算列,在这种情况下,请使用DAX创建计算列)

Long answer: Read this.

长答案:请 阅读 。

Photo by Jingda Chen on Unsplash
陈静 达在《 Unsplash》上的照片

And just like that, you did it! You made it through a basic conceptualization of Power Query, M, DAX, measures, and calculated columns. If you don’t understand all the differences and uses right now, that is perfectly okay! You have laid the foundation, and that is a huge step in the right direction.

就这样,您做到了! 您通过对Power Query,M,DAX,度量计算列进行了基本概念化。 如果您现在不了解所有差异和用途,那完全可以! 您已经奠定了基础,这是朝正确方向迈出的巨大一步。

要记住的事情: (Things to remember:)

  • Power Query is where it all begins to bring in and clean your data.Power Query是所有这些功能开始引入并清理您的数据的地方。
  • M is the language used in Power Query (you don’t have to use M directly, but it makes your life easier in the long run).

    M是Power Query中使用的语言(您不必直接使用M,但从长远来看,它会使您的生活更轻松)。

  • DAX is the language used once your data is in Power BI to create calculated columns and measures.DAX是将数据放入Power BI中后用于创建计算列和度量的语言。
  • If you can do it in Power Query/M, you should (except when you are adding a column to a table that references a column in a different table).

    如果可以在Power Query / M中执行此操作,则应该这样做 (将列添加到引用另一个表中的列的表中时除外)。

  • If a calculated column or a measure will work, use a measure.

    如果计算出的列或度量适用,请使用度量。

下一步: (Next steps:)

The easiest, and fastest, way to get these concepts to stick in your brain are by exposure and practice. Here are some great resources to get started with:

使这些概念深入大脑的最简单,最快的方法是通过接触和实践。 这里有一些很好的入门资源:

  • SQLBI

    SQLBI

  • Microsoft PBI Learning

    Microsoft PBI学习

  • Power BI Community

    Power BI社区

While I highly encourage engaging with all the wonderful resources out there, nothing is going to help you more than by trying things out on your own and seeing what happens.

尽管我极力鼓励与那里的所有宝贵资源合作,但没有什么比通过自己尝试和观察会发生的事情对您有更多帮助。

Keep banging your head against the wall. It gets so much better.

继续用力撞墙。 它变得好多了。

翻译自: https://towardsdatascience.com/power-bi-m-vs-dax-vs-measures-4c77ae270790


http://www.taodudu.cc/news/show-994836.html

相关文章:

  • 梯度下降法优化目标函数_如何通过3个简单的步骤区分梯度下降目标函数
  • seaborn 子图_Seaborn FacetGrid:进一步完善子图
  • 异常检测时间序列_时间序列的无监督异常检测
  • 存款惊人_如何使您的图快速美丽惊人
  • 网络传播动力学_通过简单的规则传播动力
  • 开源软件 安全风险_3开源安全风险及其解决方法
  • 自助分析_为什么自助服务分析真的不是一回事
  • 错误录入 算法_如何使用验证错误率确定算法输出之间的关系
  • pytorch回归_PyTorch:用岭回归检查泰坦尼克号下沉
  • iris数据集 测试集_IRIS数据集的探索性数据分析
  • flink 检查点_Flink检查点和恢复
  • python初学者_初学者使用Python的完整介绍
  • snowflake 数据库_Snowflake数据分析教程
  • 高级Python:定义类时要应用的9种最佳做法
  • 医疗大数据处理流程_我们需要数据来大规模改善医疗流程
  • python对象引用计数器_在Python中借助计数器对象对项目进行计数
  • 数字图像处理 python_5使用Python处理数字的高级操作
  • 软件测试框架课程考试_那考试准备课程值得吗?
  • 为什么在Python代码中需要装饰器
  • 数据清理最终实现了自动化
  • Python气流介绍
  • 正确的词典访问方式
  • 废水处理计算书 excel_废水监测数据是匿名的吗?
  • 数据科学还是计算机科学_您应该拥有数据科学博客的3个原因
  • 熊猫分发_流利的熊猫
  • python记录日志_5分钟内解释日志记录—使用Python演练
  • p值 t值 统计_非统计师的P值
  • 如何不部署Keras / TensorFlow模型
  • 对食材的敬畏之心极致产品_这些数据科学产品组合将给您带来敬畏和启发(2020年中的版本)
  • 向量积判断优劣弧_判断经验论文优劣的10条诫命

Power BI:M与DAX以及度量与计算列相关推荐

  1. power bi dax_M语言和Power BI中的DAX之间的差异

    power bi dax Microsoft Power BI supports two different languages, M language and DAX (Data Analysis ...

  2. Power BI中使用DAX生动展现人员头像、动态标签——销售数据里的那些商业智能

    目录 背景介绍 主要内容 数据预览 实现方案 头像展示 动态标签 总结 背景介绍 Power BI 作为一款强大的.生动的.且非常友好的商业智能软件,能帮助用户快速了解和分析数据.报表是可视化组件有机 ...

  3. power BI学习笔记-DAX函数

    DAX函数语法规范 Calculate函数 计算由指定筛选器修改的上下文中的表达式,作为表达式的结果值返回 语法:CALCULATE(<expression>,<filter1> ...

  4. Power BI笔记:给排名度量添加矢量图标效果

    以下,是我最近学习Power BI的一点技巧心得,自当笔记的同时,也分享给有需要的伙伴.其中,矢量图标部分度量值代码参考自哔哩哔哩武俊敏的作品,矢量图标路径引用代码参考自CSDN作品. ** 01. ...

  5. Power BI 2021日历表DAX代码

    日期表 = ADDCOLUMNS (CALENDAR ( date(2021,1,1),date(2021,12,31)),"年", YEAR ( [Date] ),"季 ...

  6. power bi函数_在Power BI中的行上使用聚合函数

    power bi函数 Aggregate functions are one of the main building blocks in Power BI. Being used explicitl ...

  7. Microsoft Power Platform 基础到实战(3)-Power BI (1)-数据分析表达式 DAX(1)

    目录 概述 计算 度量值 计算列 计算表 行级安全性 查询 公式 在公式中使用多个函数 函数概述 聚合函数 日期和时间函数 筛选器函数 财务函数 信息函数 逻辑函数 数学和三角函数 其他函数 关系函数 ...

  8. 2019 Power BI最Top50面试题,助你面试脱颖而出系列中

    敲黑板啦!!! 来来来 大家双眼看黑板 开始划重点啦 这篇大部分是"考试"必考题 你们一定要好好的牢记在心 一分都不要放过 刷题中... Power BI面试题目-DAX 9)什么 ...

  9. 微软认证BI专家雷元带你全面搞定Power BI数据分析

    如同当年迎接计算机的发展.互联网的冲击那样,数据将成为第一生产力.我们要如何迎接数据时代的来临? 作为一个普通人,我们如何能走在这场数字变革的前端,又如何去掌握数据分析的能力? 资深数据分析师雷元告诉 ...

最新文章

  1. 部署LAMP-mysql 安装
  2. oracle sql 分页
  3. 基线管理之Centos安全配置
  4. Android Library projetcts cannot be exported.
  5. python 接口自动化_Python 接口自动化测试
  6. crtsiii型无砟轨道板_自主知识产权CRTSⅢ型轨道板助力,赣深铁路无砟轨道轨道板灌注第一工作面完成...
  7. js实现撤销恢复_电脑硬盘丢失的资料怎么恢复?选对方法是关键
  8. 用Python解决简单的水果分类问题(一)
  9. 个性化推荐系统_推荐系统,个性化预测和优点
  10. awflasher的Vplayer 2.1 ( FLV Player )
  11. 游戏策划笔记:交互分析
  12. 薛定谔的猫量子计算机,亚马逊新的量子计算机设计竞依赖于微小的“薛定谔的猫”...
  13. 重学设计模式 - Facade模式
  14. 全球及中国食品级隔膜泵行业需求分析与发展战略规划研究报告2022-2028年
  15. Android WebView加载完成的监听
  16. android 逆向入门知识
  17. android多类型启动广告,如何在我的应用启动界面实现「开屏广告」?
  18. GJB151B CS106测试方法
  19. 一文带您了解软件多租户技术架构
  20. ID|IC|CPU卡|国密卡|二代证|防复制门禁一体机门禁读卡器带触摸键盘(不带二维码)选型必备

热门文章

  1. c++起始(名词修饰,extern “C” ,引用)
  2. linux网络编程(二)高并发服务器
  3. 覆盖所有面试知识点,送大厂面经一份!
  4. 该如何高效实用Kotlin?看这一篇就够了!
  5. android tag的作用,Android中的Context的作用(2)
  6. Objective-C语言的动态性
  7. 山东理工大学第七届ACM校赛-G 飞花的传送门
  8. jQUery中closest和parents的主要区别是
  9. win10下markdownpad2显示问题
  10. 为什么toString方法可以用来区分数组和对象?