Ravindra Bagale · Power BIसर्व coursesया course चे lessonsशोधाEnglish

Power BI · मराठी आवृत्ती

7.4 Duplicates: पूर्ण row की key?

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

पहिल्या दोन rows अगदी सारख्या आहेत. शेवटच्या दोन rows चा Order ID + Product ID सारखा आहे, पण status बदललेला आहे.

Order ID Product ID Qty Status
BLK-20001 P-101 2 Delivered
BLK-20001 P-101 2 Delivered
BLK-20002 P-205 1 Cancelled
BLK-20002 P-205 1 Delivered
Order ID Product ID Qty Status
BLK-20001 P-101 2 Delivered
BLK-20002 P-205 1 Delivered
  1. पूर्ण row duplicate तपासण्यासाठी सर्व columns निवडा आणि Home › Remove Rows › Remove Duplicates करा.
  2. Key साठी Ctrl धरून Order ID आणि Product ID निवडा; मग Remove Duplicates.
  3. Latest status हवा असेल तर वास्तविक Status Updated DateTime descending sort करा, code प्रमाणे buffer करून key वर distinct करा. Timestamp नसताना फक्त row order वरून latest ठरवू नका.
  4. आधी तपासण्यासाठी Keep Rows › Keep Duplicates वापरा.
FullRowDistinct = Table.Distinct(Source),
ByKey  = Table.Distinct(Source, {"Order ID", "Product ID"}),
// keep the latest version of each order line
Sorted = Table.Buffer(Table.Sort(Source, {{"Status Updated DateTime", Order.Descending}})),
Latest = Table.Distinct(Sorted, {"Order ID", "Product ID"})

इथे sample key Order ID + Product ID आहे. तुमच्या source मध्ये एकाच product च्या अनेक line IDs असतील तर प्रत्यक्ष line key वापरा. Table.Buffer मोठ्या data वर महाग पडू शकतो.

Practice

Solapur Hotgi Road चा export दोनदा append झाला आहे असं समजा. Keep Duplicates ने repeated lines मोजा आणि मग योग्य duplicate काढा.