0

我有一个要转换为 DAX 的嵌套 SQL 查询:

case when table1.cnt = 0 then (case when sales >= (select low from revenue where type = 'r1') and
(case when sales <= (select up from revenue where type = 'r1') then t.range1
when sales >= (select low from revenue where type = 'r2') and
(case when sales <= (select up from revenue where type = 'r2') then t.range2
else 0 end)

case when table1.cnt = 1 then (case when sales >= (select low from revenue where type = 'r1') and
(case when sales <= (select up from revenue where type = 'r1') then t.range1
when sales >= (select low from revenue where type = 'r2') and
(case when sales <= (select up from revenue where type = 'r2') then t.range2
else 0 end)
end as value

from table1
left join types t on t.cnt = table1.cnt

请帮忙!!

4

0 回答 0