sql-server - How to count number of emails and average of emails sent by hour?
问题描述
I'm working on reports with Power BI. I want to get for each hour the number of emails sent. I did the query in SQL Server but I'm having a difficulty translating it to DAX to create a measure.Also I want to get the average number of emails sent by hour.
My query is like below :
select datepart(hour,CreatedDate), count(MailId) from [DW PI].[dbo].[Email Fact]
group by datepart(hour,CreatedDate)
order by count(MailId) desc
解决方案
推荐阅读
- typescript - 动态导入vue组件时vscode不显示缺少道具错误
- c++ - 在 QMake 中,仅当目标支持 C++20 时,如何添加子目录?
- python - 如何在kivyMD中获取标签的文本输入
- python - Pandas 数据透视表中的滚动中位数
- java - 我们可以在第一次缩放 android studio 后启用移动和缩放谷歌地图相机吗?
- sql - 如何在Oracle中生成一周的第一天,一周的最后一天和两个日期之间的周数
- azure - 使用 Azure CLI 注册应用程序后在 PowerShell 中创建管理员同意会出错
- docker - 具有桥接网络的 Docker 容器无法 ping 任何东西(即使是默认网关)
- python - 使用 win32com 回复电子邮件
- flutter - 如何在 Flutter 中使用内置系统日历 App?