简体   繁体   English

Power BI 模板创建

[英]Power BI Template creation

Good afternoon.下午好。 I work for a telecom company, specifically in the Customer Success team.我在一家电信公司工作,特别是在客户成功团队。 I created a spreadsheet for one of my customers monthly invoice using the raw csv file that our billing system generates.我使用我们的计费系统生成的原始 csv 文件为我的一位客户每月发票创建了一个电子表格。 It works fine in excel, but is a bit messy, and my higher ups wanted me to start using power BI.它在 excel 中运行良好,但有点混乱,我的上司希望我开始使用 power BI。 I was able to create a much better looking report in power BI, but i'm running into the issue of recreating the report every month efficiently.我能够在 Power BI 中创建一个更好看的报告,但我遇到了每个月高效地重新创建报告的问题。 In excel, I created a template file, that allows me to copy/past the raw data, and all the slicers and pivot tables are kept and only takes me minutes to send off.在 excel 中,我创建了一个模板文件,允许我复制/粘贴原始数据,并保留所有切片器和 pivot 表,只需要几分钟就可以发送。 I've googled this a few times now and I cannot see a way to do the same thing with power BI, where i add in the csv file, and all the visualizations are kept and just the data is updated.我已经用谷歌搜索了几次,但我看不到用 Power BI 做同样事情的方法,我在其中添加了 csv 文件,所有可视化都被保留,只有数据被更新。 Any help would be appreciated任何帮助,将不胜感激

Blank Excel Pivots空白 Excel 枢轴

Excel Drop section Excel 落款

Filled Pivot Tables填充 Pivot 表

Power BI Report Power BI 报告

I tried creating a template via export in Power BI, and that didn't seem to do anything, as it just continues to load the previous data.我尝试在 Power BI 中通过导出创建模板,但似乎没有任何效果,因为它只是继续加载以前的数据。 I also tried importing a new spreadsheet, but couldn't figure out how to get the system to use the new data, rather than the old one.我还尝试导入一个新的电子表格,但无法弄清楚如何让系统使用新数据,而不是旧数据。

  1. In Power BI go to File - Options and settings - Data source settings在Power BI go 到文件-选项和设置-数据源设置
  2. You will see the file that you imported in the first place when you set up the report当您设置报告时,您将首先看到您导入的文件
  3. Click on Change Source, browse for the csv of the next month and click okay点击Change Source,浏览下个月的csv点击ok
  4. If the file structure hasn't changed Power BI will update all report pages with the new data如果文件结构未更改,Power BI 将使用新数据更新所有报表页面

在此处输入图像描述

Or use a query like this to load the newest.csv file in a folder:或者使用这样的查询加载文件夹中最新的 .csv 文件:

let
    dir = Folder.Contents("c:\temp" ),
    #"Filtered Rows" = Table.SelectRows(dir, each ([Extension] = ".csv")),
    #"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Date modified", Order.Descending}}),
    #"Contents" = Table.FirstN(#"Sorted Rows",1)[Content]{0},
    #"Imported CSV" = Csv.Document(#"Contents",[Delimiter=",", Columns=3, Encoding=1252, QuoteStyle=QuoteStyle.None])
in
    #"Imported CSV"

What you can also do, rather than have to change the file location, or use a bit of M code, is to use toload from folder .您还可以做的是使用从文件夹加载,而不是必须更改文件位置或使用一些 M 代码。 This will load all (or just one) the file(s) in a folder location.这将加载文件夹位置中的所有(或仅一个)文件。 You can set the folder on your local PC or Onedrive, dump your new file in every month, and click refresh.您可以在本地 PC 或 Onedrive 上设置文件夹,每月转储新文件,然后单击刷新。 You'll not have to change the file name it will just load everything in that folder.您不必更改文件名,它只会加载该文件夹中的所有内容。 This is helpful, if you have for example a monthly csv file that you have to load every month with that months data, Jan, Feb, March etc.这很有用,例如,如果您有一个月度 csv 文件,您必须每个月加载该月份的数据,1 月、2 月、3 月等。

在此处输入图像描述

I also recommend using Power Flow to get the csv file from an email or location, delete the contents of the source folder in OneDrive, save the new file in the OneDrive, then process the Power BI Dataset to get the latest data.我还建议使用 Power Flow 从 email 或位置获取 csv 文件,删除 OneDrive 中源文件夹的内容,将新文件保存在 OneDrive 中,然后处理 Power BI 数据集以获取最新数据。

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

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