Multiple Date Columns in Fact Table
အောက်ပါ Sale Table တွင် Order မှာယူသည့် Date နှင့် ၎င်း Order များကို Deliver ပြုလုပ်သည့် Date ဟူ၍ Date Column နှစ်ခုပါရှိပါသည်။
10.5 Date Column တစ်ခုထက်ပိုသည့် FACT Table များကို ကိုင်တွယ်တွက်ချက်ခြင်း

အထက်ပါ Sales Table နှင့် Date Table တို့အကြား အောက်ပါအတိုင်း Relationship ချိတ်ဆက် ပါမည်။

ထို့အပြင် PowerPivot Window ၏ Design Tab အောက်ရှိ Manage Relationship မှ လည်း Relationship အား လိုအပ်သကဲ့သို့ Edit ပြုလုပ်နိုင်သည်။ Active မဖြစ်သည့် Relationship ကို အသုံးပြု၍ တွက်ချက်မှုများပြုလုပ်လိုသည့်အခါ USERELATIONSHIP ဟူသည့် Function ကို အသုံးပြုတွက်ချက်ရမည်ဖြစ်သည်။
နှစ်အလိုက်၊ လအလိုက် Ordered Quantity များတွက်ချက်လိုသည့်အခါ Sales Table ၏ Ordered Date နှင့် Date Table ၏ Date ကို ချိတ်ဆက်ထားသော Relationship ကို အသုံးပြု၍ တွက်ချက်ပါဟု အောက်ပါအတိုင်း ရေးသားတွက်ချက်ရမည်ဖြစ်သည်။
Ordered Qty:=CALCULATE( SUM(Sales[Quantity]),
USERELATIONSHIP( Sales[Ordered Date], ‘Date’[Date]))
အလားတူပင် နှစ်အလိုက်၊ လအလိုက် Ordered Quantity များ တွက်ချက်လိုသည့်အခါ Delivered Date ဖြင့် Relationship ဖြင့် ချိတ်ဆက်ရန် အောက်ပါအတိုင်း ရေးသာရမည် ဖြစ်ပါသည်။
Delivered Qty:=CALCULATE( SUM(Sales[Quantity]),
USERELATIONSHIP( Sales[Delivered Date], ‘Date’[Date]))

အထက်ပါပုံတွင် Sales Table မှ Ordered Date နှင့် Date Table မှ Date ကို လည်းကောင်း၊ Sales Table မှ Delivered Date နှင့် Date Table မှ Date ကို လည်းကောင်း အသီးသီး Relationship ချိတ်ဆက်ထားခြင်း ဖြစ်ရာ Table တစ်ခုနှင့် တစ်ခုကြား Realtionship တစ်ခုသာ Active Relationship အဖြစ် ချိတ်ဆက်နိုင်သည့်အတွက် အထက်ပါပုံတွင် Relationship တစ်ခုမှာ Dot Line အဖြစ်၊ တစ်နည်း အားဖြင့် Inactive Relationship အဖြစ် တွေ့မြင်ရခြင်း ဖြစ်သည်။
ချိတ်ဆက်ထားရှိသည့် Relationship ၏ အခြေအနေကို Active မှ Inactive ၊ Inactive မှ Active အဖြစ် ပြောင်းလဲလိုပါက Relationship Line အပေါ်တွင် Right Click ထောက်၍ လိုအပ်သလို ရွေးချယ် နိုင်သည်။

ဤစာမျက်နှာတွင်ပါဝင်သည့် ခေါင်းစဉ်များ
Inactive ဖြစ်သည့် Relationship ကို USERELATIONSHIP ဖြင့် အသုံးပြု၍ တွက်ချက်စေပါက အခြား Active ဖြစ်နေသည့် Relationship ကို Formula တွက်ချက်နေစဉ်အတွင်း ယာယီ Inactive ဖြစ်စေ၍ တွက်ချက်မှုပြီးဆုံးသည့်အခါ ပုံမှန်အတိုင်း ပြန်လည် Active ဖြစ်စေမည် ဖြစ်သည်။
Active ဖြစ်နေသည့် Relationship ကိုလည်း USERELATIONSHIP ဖြင့် အသုံးပြုရေးသားနိုင်ပါ သည်။ မည်သည့် ပြဿနာမှ ဖြစ်ပေါ်မည် မဟုတ်ပါ။

