简体   繁体   English

在 Power BI 中反透视数据

[英]Unpivot Data in Power BI

I have an Excel file that looks like this:我有一个看起来像这样的 Excel 文件:

Component零件 Italy意大利 Austria奥地利 Germany德国
One Not active不活跃 Not active不活跃 Active积极的
Two Active积极的 Not active不活跃 Active积极的
Three Active积极的 Not active不活跃 Not active不活跃
Four Not active不活跃 Active积极的 Active积极的

I wanted to create a normalized table to use in Power BI,我想创建一个规范化表以在 Power BI 中使用,

Component零件 Country国家 Status地位
One Italy意大利 Not active不活跃
One Austria奥地利 Not active不活跃
One Germany德国 Active积极的
... ... ... ... ... ...
Four Italy意大利 Not active不活跃
Four Austria奥地利 Active积极的
Four Germany德国 Active积极的

Usually the normalized tables are the one I use in Power BI, my question is:通常规范化表是我在 Power BI 中使用的表,我的问题是:

  • is there any way to transform the data source in Power BI to have the normalized structure?有什么方法可以将 Power BI 中的数据源转换为标准化结构? or或者
  • is it possible to handle the original format in Power BI in some way?是否可以以某种方式处理 Power BI 中的原始格式?

You should definitely reshape this data.你绝对应该重塑这些数据。 When importing in PQ, highlight the Component column and then on the transform tab of the ribbon, select unpivot other columns.在 PQ 中导入时,突出显示组件列,然后在功能区的转换选项卡上,select 取消旋转其他列。 You can then rename the columns as you see fit.然后,您可以根据需要重命名列。

在此处输入图像描述

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

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