mysql 如何将SQL语句转换为Power BI DAX?

yduiuuwa  于 2023-10-15  发布在  Mysql
关注(0)|答案(3)|浏览(137)

我不知道如何在Power BI中重新创建从SQL到DAX的以下代码:

select Z, sum(X) as sumcount, avg(Y) as avgcount
from example_table
group by Z

或者也许有一种方法可以在Power BI中使用导入和过滤的表操作SQL命令?
我想在Power BI中对已经切片的数据进行SQL查询。
谢谢你提前:)

0tdrvxhp

0tdrvxhp1#

你可以通过下面的dax计算表来实现这一点

Table = summarize(example_table[z], "sumcount", sum(example_table[x]), " Avgcount", Average(example_table[Y]))
epggiuax

epggiuax2#

你可以从直接查询功能中执行sql查询,其中连接数据主机和模式。

ctehm74n

ctehm74n3#

如何在Power BI中创建从SQL到DAX的代码:

Select
   History.[Key],
   History.[Issue Type],
   History.[Current Status],
   SUM(History.[Time in Old Value (business days)]) as 'Blocked Time'
FROM History
INNER JOIN CYCLOTIME
   ON HISTORY.[KEY] = CYCLOTIME.[KEY]
   AND HISTORY.[History Start] >= CycloTime.[Dt Inicio]
Where 
   History[History Field] = "flagged"
and
   History[History Old Value] = "Impedimento"
GROUP BY
   History.[Key],
   History.[Issue Type],
   History.[Current Status]

相关问题