如何将以下查询表达式转换为 DAX表达式:
SELECT Column3, Column2 FROM table2 WHERE Column4 < 450
答案 0 :(得分:2)
在Power BI的“建模”选项卡中,单击“新建表” ,然后使用以下表达式:
let temp = [];
db.collection("Users").onSnapshot(res => {
const changes = res.docChanges();
changes.forEach(change => {
if (change.type === "added") {
temp.push({
id: change.doc.id,
email: change.doc.data().email
});
}
});
console.log(temp);
console.log(temp.length);
});
答案 1 :(得分:1)
您也可以使用FILTER
New Table =
SELECTCOLUMNS (
FILTER ( 'table2', 'table2'[Column4] < 450 ),
"New Column 2", 'table2'[Column2],
"New Column 3", 'table2'[Column3]
)