一、在PowerBI portal端需要准备的操作:

1. https://app.powerbi.cn 登陆,点击左侧My Workspace,你需要有一个账号

2. 选入Datasets,点击页面右上角的Creat,添加Streaming dataset

3.添加API{ }

4.记录Push URL , 这个后续作为post data的URL

二、在c#代码中的操作:

  1. realTimePushURL 改成上文你的Push URL
  2. 一定要注意数据结构 那个postData变量的结构要和streaming dataset的结构一致
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    using System.IO; namespace StreamDataToPowerBI
    {
    class Program
    {
    // Paste your own push URL below
    // e.g. https://api.powerbi.com/beta/2b958e42-b81e-441d-af13-801621ce8401/datasets/a5a15fd1-8cb6-4527-b2e6-f22f2a274d4d/rows?key=apsBX1ef%2F8a7ToL2xxxxxxxxxxxZeGATSyRYerZKpnu%2FbE2g2yDM0%2Bs4cDW9mqu5zKoGcQ27vJuh0Huw%3D%3D
    private static string realTimePushURL = "** paste your push URL here **";
    static void Main(string[] args)
    {
    while (true) {
    try
    {
    // Declare values that we're about to send
    String currentTime = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); //2017-11-03T06:23:35.521Z
    Random r = new Random();
    int currentValue = r.Next(, );
    // Send POST request to the push URL
    // Uses the WebRequest sample code as documented here: https://msdn.microsoft.com/en-us/library/debx8sh9(v=vs.110).aspx
    WebRequest request = WebRequest.Create(this.PostUri);
    request.Method = "POST";
    string postData = String.Format("[{{ \"time\": \"{0}\", \"value\": {1}}}]", currentTime, currentValue);
    Console.WriteLine(String.Format("Making POST request with data: {0}", postData));
    // Prepare request for sending
    byte[] byteArray = Encoding.UTF8.GetBytes(postData);
    request.ContentLength = byteArray.Length; // Get the request stream.
    Stream dataStream = request.GetRequestStream(); // Write the data to the request stream.
    dataStream.Write(byteArray, , byteArray.Length); // Close the Stream object.
    dataStream.Close(); // Get the response.
    WebResponse response = request.GetResponse(); // Display the status.
    Console.WriteLine(String.Format("Service response: {0}", ((HttpWebResponse)response).StatusCode)); // Get the stream containing content returned by the server.
    dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access.
    StreamReader reader = new StreamReader(dataStream); // Read the content.
    string responseFromServer = reader.ReadToEnd(); // Display the content.
    Console.WriteLine(responseFromServer); // Clean up the streams.
    reader.Close();
    dataStream.Close();
    response.Close(); }
    catch (Exception ex)
    {
    Console.WriteLine(ex);
    }
    // Wait 1 second before sending
    System.Threading.Thread.Sleep();
    }
    }
    }
    }

三、在portal中设置展示结果,大致实现过程:

1. 先创建一个dashboard

2. 点击右上角的Add tile

3. 选定我们的streaming data tile

4. 执行相应的添加即可

5.实时展示结果:(实时更新显示C#代码发来的random数据)

Power BI 实现实时更新Streaming Dataset的更多相关文章

  1. 微软Power BI 每月功能更新系列——12月Power BI 新功能学习

    Power BI Desktop12月产品功能摘要 Power BI 作为实力宠粉达人每月更新不来点新花样,怎么对得起翘首期待的实力铁粉您嘞!一起来看看这一次的Power BI版本的更新又给我们带来了 ...

  2. 微软Power BI 每月功能更新系列——4月Power BI 新功能学习

    本月Power BI Desktop的更新,除了常规的视觉和数据连接器改进之外,还有两个非常大的功能改进,交互式的报表.问答,用户直接在Desktop可以询问有关的数据问题,面对层出不穷的用户需求,这 ...

  3. 微软Power BI 每月功能更新系列——10月Power BI 新功能学习

    Power BI Desktop10月产品功能摘要 本月Power Plus Desktop的更新充满了整个产品的小型和大型改进.一个巨大的更新是Power BI服务支持我们的复合模型和聚合预览.这实 ...

  4. 微软Power BI 每月功能更新系列——6月Power BI 新功能学习

    Power BI Desktop 6月产品功能摘要 本月Power BI Desktop的更新,专注于图表格式化的灵活性调整,通过过滤和排序选项,数据视图现在更加强大.多个连接器也获得重大更新,其中包 ...

  5. 微软Power BI 每月功能更新系列——7月Power BI 新功能学习

    Power BI Desktop 7月产品功能摘要 7月是Power BI Desktop团队的重要发布!但由于官方延迟更新,我们的讲述也就更晚了一点,也许大家觉得没有必要了,都8月了,谁还看7月的? ...

  6. 微软Power BI 每月功能更新系列——9月Power BI 新功能学习

    Power BI Desktop 9月新功能摘要 Power BI 9月更新如期而至,这一次Power BI 又推出了新功能——聚合预览,它可在内存中无缝地存储汇总值,大大提高报告的性能.另外本月还包 ...

  7. 2019微软Power BI 每月功能更新系列——3月Power BI 新功能学习

    Power BI3月产品功能更新发布啦!本次新功能新增了热图和单选切片器:完善了新的DAX功能和对现有功能的改进(例如按钮和选择窗格):同时官方表示建模视图的全面改进也正在进行中~Woo~那么,本月更 ...

  8. 2019微软Power BI 每月功能更新系列——2月Power BI 新功能学习

    哈喽,小伙伴们,我是小悦悦,好久不见~ 春节假期结束,新一轮的工作开始,祝大家猪年如意,开工大吉! 今天小悦悦带你走入猪年学习的正确打开方式——Power BI新一年的持续更新学习!   Power ...

  9. 2019微软Power BI 每月功能更新系列——Power BI 4月版本功能完整解读

    Power BI4月份的更新对整个产品进行了重大更新.此版本增加了基于DAX表达式定义视觉效果标题和按钮URL的功能.本月Power BI也新增了许多新的连接器,现在可以使用几种预览连接器,包括Pow ...

随机推荐

  1. ML.NET 示例:二元分类之垃圾短信检测

    写在前面 准备近期将微软的machinelearning-samples翻译成中文,水平有限,如有错漏,请大家多多指正. 如果有朋友对此感兴趣,可以加入我:https://github.com/fei ...

  2. 我的物联网项目专题移到网站:http://51jdk.com

    我的物联网项目专题移到网站:http://51jdk.com

  3. (8)学习笔记 ) ASP.NET CORE微服务 Micro-Service ---- Ocelot网关(Api GateWay)

    说到现在现有微服务的几点不足: 1) 对于在微服务体系中.和 Consul 通讯的微服务来讲,使用服务名即可访问.但是对于手 机.web 端等外部访问者仍然需要和 N 多服务器交互,需要记忆他们的服务 ...

  4. OSGI的WEB开发环境搭建

    第一步,搭建OSGI环境: 打开eclipse,点击run->run configration..,配置如下,点击run. 运行结果如下图所示:说明OSGI环境搭建完毕. 第二步:搭建基于OSG ...

  5. 浏览器跨域请求之credentials

    -时间起源- 前段时间,需要弄个简单的网站出来,访问远程的api服务. 我是这么做的.首先是在搭建一个nodejs服务来运行前端页面.在我请求登录的时候,能成功返回相应的成功信息.然后,当我再次请求读 ...

  6. 剑指offer:二叉树中和为某一值的路径

    本来这只是一个普通的算法题,但是当初自己OJ上提交时,总是提交失败,而我自己认定程序逻辑没有任何问题.然后开始就在本机上调试,结果发现这是由于Python的对象机制而引发的.所以先把问题算法题贴出来, ...

  7. Mooc总结——Linux内核分析

    朱荟潼+ 原创作品转载请注明出处 :<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 学习笔记链接汇总 第 ...

  8. PAT L2-021 点赞狂魔

    https://pintia.cn/problem-sets/994805046380707840/problems/994805058485469184 微博上有个“点赞”功能,你可以为你喜欢的博文 ...

  9. Oracle 控制文件管理

    控制文件是一个很小的二进制文件(10MB左右),含有数据库结构信息,包括数据文件和日志文件信息.控制文件在数据库创建时被自动创建,并在数据库发生物理变数时更新.控制文件被不断更新,在任何时候都要保证控 ...

  10. [cnbeta]iPhone 2018年全球出货2.25亿部:中国区下滑两成

    iPhone 2018年全球出货2.25亿部:中国区下滑两成 2019年01月22日 20:12 501 次阅读 稿源:快科技 0 条评论   https://www.cnbeta.com/artic ...