简体   繁体   English

为 Power BI 生成文档

[英]Generating documentation for Power BI

Is there a native solution/application/script for creating documentation in Power BI?是否有用于在 Power BI 中创建文档的本机解决方案/应用程序/脚本? I am especially interested in documenting all relationships.我对记录所有关系特别感兴趣。

Power BI Models (and the new Tabular Models) have DMVs that are separate from the MDSCHEMA rowsets for SSAS multidimensional. Power BI 模型(和新的表格模型)具有与 SSAS 多维的 MDSCHEMA 行集分开的 DMV。 While some of the SSAS MD DMVs mostly work, the new TMSchema DMVs work well since they are made specifically for this type of model.虽然一些 SSAS MD DMV 主要工作,但新的 TMSchema DMV 工作良好,因为它们是专门为这种类型的模型制作的。 The trick is that you must know the connection info.诀窍是您必须知道连接信息。 The port and database number change each time you open Power BI Desktop.每次打开 Power BI Desktop 时,端口和数据库号都会更改。 But generating documentation can be done.但是可以生成文档。

There are a couple of ways to go about it.有几种方法可以解决这个问题。 You can use DAX Studio to get your connection info ( a la Chris Webb ).您可以使用 DAX Studio 来获取您的连接信息( a la Chris Webb )。 Or you can get that info dynamically from Power BI ( a la The BIccountant ).或者,您可以从 Power BI(如 The Biccountant )动态获取该信息。 Using DAX Studio works as a one-time way to get documentation, or if you are ok updating the connection and database info each time you want to run it.使用 DAX Studio 是一种一次性获取文档的方式,或者如果您可以在每次运行时更新连接和数据库信息。 The BIccountant way is more dynamic. BIccountant 方式更具动态性。 I haven't tried it, but it looks promising.我还没有尝试过,但看起来很有希望。

To get relationships, you can get your connection info for your Power BI model and then run queries against the following DMVs:若要获取关系,可以获取 Power BI 模型的连接信息,然后针对以下 DMV 运行查询:

  • $System.TMSCHEMA_RELATIONSHIPS $System.TMSCHEMA_RELATIONSHIPS
  • $System.TMSCHEMA_TABLES $System.TMSCHEMA_TABLES
  • $System.TMSCHEMA_COLUMNS $System.TMSCHEMA_COLUMNS

Pull those down into Power BI (either in the same model you are documenting, or in a different model).将它们拉入 Power BI(在您正在记录的同一模型中,或在不同的模型中)。 Then either那么要么

A) Use the Edit Queries functionality to merge the queries to add the Name column from the Tables DMV and the Explicit Name column from the Columns DMV based upon FromTableID, FromColumnID, ToTableID, ToColumnID. A) 使用编辑查询功能合并查询,以根据 FromTableID、FromColumnID、ToTableID、ToColumnID 添加 Tables DMV 中的 Name 列和 Columns DMV 中的 Explicit Name 列。

B) Create relationships between these columns using the modeling functionality of Power BI to achieve the same affect. B) 使用 Power BI 的建模功能在这些列之间创建关系以实现相同的效果。

Once you've done this and cleaned up column names, hidden/deleted unused fields, you can then use Power BI to create your documentation.完成此操作并清理列名称、隐藏/删除未使用的字段后,您就可以使用 Power BI 创建文档。 You can create plain tables and/or use something like a force-directed graph to show relationships.您可以创建普通表格和/或使用类似力导向图的东西来显示关系。 Here's a screenshot of one that I made.这是我制作的一个屏幕截图。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM