Power BI

  什么是Power BI?相信360百科会给你满意的答复,我这里仅做简单的阐述。它的全称叫Power Business Intelligence,即商业智能增强版。由微软为Office组件提供的一套商业智能工具,包含四个插件:查询增强版(Power Query)、建模增强版(Power Pivot)、视图增强版(Power View)、地图增强版(Power Map),突破了Excel表格结构数据的短板。基本满足现代商业数据的业务分析需求,方便实用高效。

业务解读

  一位做餐饮的老板想要掌握各家分店每天各时段的运营情况,以此及时调整、优化经营方案。对此,需要先搭建一个、多个多维度的信息交叉的数据表,并构建相关的观测指标。
  从各分店的数据采集设备获得的原始数据信息分散在多个数据表中,这里需要先用MYSQL创建多维度的信息交叉的数据表,下面是三个原始数据表的字段说明。


  结合餐饮业的实际经营情况,我们需要构建下面的KPI,来掌握所经营分店每天的运营状况,每个KPI的含义如下图所示。

数据准备

  在MYSQL中用原始数据表创建多维度交叉信息所用的代码如下:

drop database ls;
create database cy;
use cy;
--        --------------创建三个表--------alter
create table Bill(
billdate date ,
billnumber varchar(20) not null default '-',
shopname varchar(20) not null default '-',
billdiscount float not null default 0,
paytime time not null,
tablenumber int not null default 0,
peoplecount int not null default 0
);create table OrderDetail(
billnumber varchar(20) not null default '-',
detail varchar(20) not null default '-',
pay int not null default 0
);create table ShopDetail(
ShopName varchar(20) not null default '-',
twotable int not null default 0,
threetable int not null default 0,
fourtable int not null default 0,
alltable int    not null default 0
);
-- ----------------------------导入三个表-----------------------
load data local infile 'C:\\CDA data\\-bill.txt' into table Billfields terminated by ',';
--     ignore 1 lines;
drop table Bill;
select * from Bill;load data local infile 'C:\\CDA data\\-order.txt' into table OrderDetailfields terminated by '\,';
--     ignore 1 lines;
drop table OrderDetail;
select * from OrderDetail;load data local infile 'C:\\CDA data\\-shop.txt' into table ShopDetailfields terminated by '\,';
--    ignore 1 lines;
drop table ShopDetail;select * from ShopDetail;
select * from OrderDetail;
select * from Bill;-- 数据加工
-- 创建单汇总金额表  drop table
drop table ordergroup;
create table ordergroup
(select billnumber, sum(pay) as pay
from orderdetail
group by billnumber);select * from ordergroup;drop table NewBill;
-- 创建新单号详细表
Create table NewBill(
select b.*,o.pay,b.billdiscount * o.pay as rebate from bill as b left join ordergroup as o
on b.billnumber = o.billnumber);select * from NewBill;drop table NewShopDetail;
-- 创建新店面情况表
create table NewShopDetail(
select *, (twotable * 2 + threetable * 3 + fourtable * 6) as allseats
from shopdetail as s);select * from NewShopDetail;drop table neworderdetail;
-- 创建新点菜明细表
create table neworderdetail(
select b.shopname,o.*
from orderdetail as o left join bill as b
on o.billnumber = b.billnumber
);select * from neworderdetail;drop table ShopTotal;
-- 创建店汇总信息表
create table ShopTotal(
select b.shopname as 店名, count(b.billnumber) as 单数,
sum(b.peoplecount) as 人数,sum(b.rebate) as 折扣总金额,sum(b.pay) as 店汇总金额,
sum(b.pay)/count(b.billnumber) as 单均消费,
sum(b.pay)/sum(b.peoplecount) as 人均消费,
s.alltable as 总台数,
s.allseats as 总座位数,
count(b.billnumber)/s.alltable as 翻台率,
sum(b.peoplecount)/s.allseats as 上座率,
sum(b.rebate)/sum(b.pay) as 折扣率
from newbill as b ,newshopdetail as s
where b.shopname = s.shopname
group by b.shopname);select * from shoptotal;

  最后得到的多维度信息交叉数据表之一如下截图所示:

制作分析仪

  得到最终的几个多维度交叉信息数据表后,便是将其所包含的信息以较好的方式展示给该餐饮老板。这里用到了Power BI 的Power Query、Power Pivot组件。利用Power Query查询数据表的关键信息以构建宽表,利用Power Pivot将查询到的数据进行规范调整。Power Query、Power Pivot的操作如下图所示。


  最后通过Power Pivot的主页选项卡下的数据透视图、透视表等一系列细节处理得到该餐饮产业各分店的销售情况分析仪。该分析仪通过选取不同的店名,即可查看该分店当天各时段不同菜品的销售额变化情况及销量趋势、10个KPI则可展示不同分店的用餐资源使用情况及收益变化等信息。最后得到的分析仪如下图。

【Power BI】分析仪在餐饮业中的应用相关推荐

  1. sql power bi_在SQL,Power BI和MS Excel中计算移动平均值

    sql power bi In this article, I'm going to talk in detail about the moving average in SQL and how to ...

  2. power bi指标呈现_在Power BI中使用关键绩效指标

    power bi指标呈现 In this article, we will learn Key Performance Indicators usage in Power BI and solve a ...

  3. 在Power BI Desktop报告中使用图像

    介绍 (Introduction) In the article Web URL configuration in a Power BI Desktop report, we explored a d ...

  4. power bi 创建空表_如何使用R在Power BI中创建地理地图

    power bi 创建空表 介绍 (Introduction) This is the fifth article of a series dedicated to discovering geogr ...

  5. 汇编在嵌入式编程中的作用_如何在嵌入式Power BI报表中以编程方式传递凭据

    汇编在嵌入式编程中的作用 In the article, How to embed a Power BI Report Server report into an ASP.Net web applic ...

  6. Power BI中配置Python运行环境,及相关错误问题解决

    Power BI Desktop中支持python,在Power BI的数据获取.数据转换.数据可视化.数据输出的全流程中,都可以支持使用Python.关于如何全流程使用Python,可以参见文章ht ...

  7. Power BI for Office 365(七) Power BI站点

    报表分享是Power BI for Office 365比较关键的一个功能,其中提供的Power BI站点将给这些报表一个安全的"归宿",同时也可以跟任何想要分享的人进行协作--- ...

  8. Microsoft Power BI 学习笔记

    ​   Power Bi 学习笔记 一   Power BI 是微软发布的一系列的软件服务.应用和连接器,这些软件服务.应用和连接器协同工作,将不相关的数据源转化为合乎逻辑.视觉上逼真的交互式见解. ...

  9. html 接收 图片流_Microsoft Flow 利用自动化工作流增强Power BI使用效率

    [前述:Microsoft Flow和Power BI都属于微软Power平台的一部分.在微软Power平台的官网,你可以看到关于该平台的以下介绍: "Power BI.PowerApps和 ...

最新文章

  1. 重装windows installer
  2. java camel dsl,Apache Camel与Spring DSL
  3. MySQL学习(四)
  4. android初学之退出应用程序
  5. LeetCode之Find All Numbers Disappeared in an Array
  6. linux 非阻塞 socket - Google 搜索
  7. gnuplot使用备忘
  8. C#中的String类
  9. ITK在vs2010下安装、搭建
  10. 一个类似百度的搜索。。。。。
  11. PCL 显示一只小白兔和Eigen矩阵
  12. 斗鱼tv 服务器响应失败,斗鱼tv打不开怎么办 斗鱼直播打不开得解决办法
  13. matlab 计算逆时针夹角,计算两个向量的逆时针夹角
  14. 快速画圆切线lisp_autolisp中画两圆公切线的程序怎么写?
  15. 链接提交提示安全验证,网站辅助快排不行了吗?
  16. python把字典保存到文件_将Python字典保存到文件中,并定期更新它
  17. conversion failed: could not load input document
  18. VMware16虚拟机:在Windows10系统下---安装VMware tools
  19. IMSI 和 IMEI
  20. 2022-04-26 linux文件系统解读

热门文章

  1. 咏南linux中间件状态查看,咏南跨平台中间件
  2. 一步一步教你搭建jenkins
  3. vue生命周期,组件,slot替换,tab切换,简易留言板
  4. layui分页和模板引擎
  5. CF869C The Intriguing Obsession 题解
  6. 中年男人失业,滴滴,外卖,保安三选一,怎么选?
  7. 知云文献翻译打不开_沙拉查词—— 划线翻译的一股清流
  8. django框架使用pdf.js 使用说明
  9. Android开发者要搬运多少年代码才能突破年薪40W?
  10. luat c语言开发例程,Luat实例教程:tcp透传