如何将 sql 查询转换为 dax 查询
How can i convert sql query into dax query
我想在 power bi 中将 sql 查询转换为 dax
我的 table 是:-
channel advertiser yr
colors pepsi 2019
colors apple 2019
colors pepsi 2018
colors google 2018
colors lux 2019
我已经尝试 sql 查询来寻找新的广告商:-
select advertiser from ads
where yr=2019 and advertiser not in --new ads
(select advertiser from ads
where yr=2018 )
我想将此查询转换为 dax,我该怎么做?
我试过这个:
EVALUATE
CALCULATETABLE (VALUES(adv[advertiser]),
adv[channel]="colors",
adv[year]=2019 && VALUES(adv[advertiser])
not (VALUES(adv[advertiser]),
adv[year]=2018
))
有人能帮忙吗?提前致谢..!!
这将 return table 与 "new" 广告商
EVALUATE
CALCULATETABLE (
VALUES(adv[advertiser])
,adv[channel]="colors"
,adv[year]=2019
, NOT adv[advertiser] IN CALCULATETABLE (
VALUES(adv[advertiser])
,adv[year]=2018
))
我想在 power bi 中将 sql 查询转换为 dax 我的 table 是:-
channel advertiser yr
colors pepsi 2019
colors apple 2019
colors pepsi 2018
colors google 2018
colors lux 2019
我已经尝试 sql 查询来寻找新的广告商:-
select advertiser from ads
where yr=2019 and advertiser not in --new ads
(select advertiser from ads
where yr=2018 )
我想将此查询转换为 dax,我该怎么做? 我试过这个:
EVALUATE
CALCULATETABLE (VALUES(adv[advertiser]),
adv[channel]="colors",
adv[year]=2019 && VALUES(adv[advertiser])
not (VALUES(adv[advertiser]),
adv[year]=2018
))
有人能帮忙吗?提前致谢..!!
这将 return table 与 "new" 广告商
EVALUATE
CALCULATETABLE (
VALUES(adv[advertiser])
,adv[channel]="colors"
,adv[year]=2019
, NOT adv[advertiser] IN CALCULATETABLE (
VALUES(adv[advertiser])
,adv[year]=2018
))