Power BI · मराठी आवृत्ती
13.9 FILTER
FILTER(table, condition) condition true असलेल्या rows ची table देतो. तो iterator आहे. Measure-based किंवा अनेक columns च्या complex logic साठी उपयोगी.
Loyal Customers =
COUNTROWS(
FILTER(VALUES(Customer[Customer ID]), [Total Orders] >= 10)
)
Sales from Loyal Customers =
CALCULATE(
[Total Sales],
FILTER(VALUES(Customer[Customer ID]), [Total Orders] >= 10)
)
Slow Stores =
COUNTROWS(
FILTER(VALUES(DarkStore[Store ID]), [Avg Delivery Time (mins)] > 15)
)
Loyal Customers example मध्ये सध्याच्या filter period मधल्या ≥10 orders असलेले customers घेतले आहेत; तो आपोआप lifetime loyalty नाही. Slow Stores मध्ये current average >15 हा practice threshold आहे.
शक्य असेल तर छोटा column filter
CALCULATE([Total Sales], Orders[Discount] > 0) पुरेसं असताना पूर्ण Orders table FILTER करू नका. छोट्या column list वर filtering अधिक स्पष्ट आणि अनेकदा कार्यक्षम ठरते.