Forum Discussion
KB88
1 year agoFrequent Visitor
Simulated weighted average payment type
I am trying to use a what-if parameter to make a simulated weighted average payment term measure. I have 2 files, 1 with payment terms and the number of days associated. The other file is the main da...
- 1 year ago
Hi KB88 ,
Thank you for reaching out to Microsoft Fabric Community Forum.
Can you try this i have changed the dax which will sync with date slicer
SimulatedWAPT_Final = VAR SimVendor = SELECTEDVALUE('SC Data'[Vendor Name]) VAR SimDays = SELECTEDVALUE('New Payment Term'[New Payment Term Value]) VAR VendorSpendTable = FILTER( ALLSELECTED('SC Data'), 'SC Data'[Vendor Name] = SimVendor && NOT ISBLANK('SC Data'[PO Payment Term]) && 'SC Data'[PO Payment Term] <> "#" ) VAR VendorOriginalWeighted = SUMX( VendorSpendTable, 'SC Data'[Spend] * RELATED('Payment Terms'[DAYS]) ) VAR VendorSimulatedWeighted = SUMX( VendorSpendTable, 'SC Data'[Spend] * IF(ISBLANK(SimDays), RELATED('Payment Terms'[DAYS]), SimDays) ) VAR AllFilteredData = FILTER( ALLSELECTED('SC Data'), NOT ISBLANK('SC Data'[PO Payment Term]) && 'SC Data'[PO Payment Term] <> "#" ) VAR OriginalWeightedTotal = SUMX( AllFilteredData, 'SC Data'[Spend] * RELATED('Payment Terms'[DAYS]) ) VAR AdjustedWeightedTotal = IF( NOT ISBLANK(SimVendor) && NOT ISBLANK(SimDays), OriginalWeightedTotal - VendorOriginalWeighted + VendorSimulatedWeighted, OriginalWeightedTotal ) VAR AdjustedTotalSpend = CALCULATE( SUM('SC Data'[Spend]), AllFilteredData ) RETURN DIVIDE(AdjustedWeightedTotal, AdjustedTotalSpend)Regards,
Chaithanya.
v-kathullac
1 year agoCommunity Support
Hi KB88 ,
we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya.