ISINSCOPE
นําไปใช้กับ:การคํานวณคอลัมน์จากการคํานวณ ตารางจากการคํานวณ หน่วยวัดการคํานวณวิชวล
ส่งกลับเป็น true เมื่อคอลัมน์ที่ระบุคือระดับในลําดับชั้นของระดับ
ไวยากรณ์
ISINSCOPE(<columnName>)
พารามิเตอร์
เงื่อนไข | คำนิยาม |
---|---|
columnName | ชื่อของคอลัมน์ที่มีอยู่โดยใช้ไวยากรณ์ DAX มาตรฐาน ไม่สามารถเป็นนิพจน์ได้ |
ค่าที่ส่งกลับ
TRUE เมื่อคอลัมน์ที่ระบุคือระดับในลําดับชั้นของระดับ
หมายเหตุ
ฟังก์ชันนี้ไม่ได้รับการสนับสนุนสําหรับการใช้งานในโหมด DirectQuery เมื่อใช้ในคอลัมน์จากการคํานวณหรือกฎการรักษาความปลอดภัยระดับแถว (RLS)
ตัวอย่าง
DEFINE
MEASURE FactInternetSales[% of Parent] =
SWITCH (TRUE(),
ISINSCOPE(DimProduct[Subcategory]),
DIVIDE(
SUM(FactInternetSales[Sales Amount]),
CALCULATE(
SUM(FactInternetSales[Sales Amount]),
ALLSELECTED(DimProduct[Subcategory]))
),
ISINSCOPE(DimProduct[Category]),
DIVIDE(
SUM(FactInternetSales[Sales Amount]),
CALCULATE(
SUM(FactInternetSales[Sales Amount]),
ALLSELECTED(DimProduct[Category]))
),
1
) * 100
EVALUATE
SUMMARIZECOLUMNS
(
ROLLUPADDISSUBTOTAL
(
DimProduct[Category], "Category Subtotal",
DimProduct[Subcategory], "Subcategory Subtotal"
),
TREATAS(
{"Bike Racks", "Bike Stands", "Mountain Bikes", "Road Bikes", "Touring Bikes"},
DimProduct[Subcategory]),
"Sales", SUM(FactInternetSales[Sales Amount]),
"% of Parent", [% of Parent]
)
ORDER BY
[Category Subtotal] DESC, [Category],
[Subcategory Subtotal] DESC, [Subcategory]
กลับ
DimProduct[Category] | DimProduct[SubCategory] | [Category Subtotal] | [Subcategory Subtotal] | [Sales] | [% of Parent] |
---|---|---|---|---|---|
TRUE | TRUE | 28,397,095.65 | 100.00 | ||
อุปกรณ์ | FALSE | TRUE | 78,951.00 | 0.28 | |
อุปกรณ์ | แร็คจักรยาน | FALSE | FALSE | 39,360.00 | 49.85 |
อุปกรณ์ | แท่นวางจักรยาน | FALSE | FALSE | 39,591.00 | 50.15 |
จักรยาน | FALSE | TRUE | 28,318,144.65 | 99.72 | |
จักรยาน | จักรยานเสือภูเขา | FALSE | FALSE | 9,952,759.56 | 35.15 |
จักรยาน | จักรยานเสือหมอบ | FALSE | FALSE | 14,520,584.04 | 51.28 |
จักรยาน | จักรยานแบบทัวริ่ง | FALSE | FALSE | 3,844,801.05 | 13.58 |
เนื้อหาที่เกี่ยวข้อง
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ