Please note that this method is suitable for MCA CSP Partner Customers who pass the PayG Cost for their Channel customers.
To calculate the margin using the Amortized Cost metric, follow the below steps:
Step 1: Create the Perspective for Azure Partner Customers (Skip this step if you already have the Perspective for Azure Partner Customers.)
Step 2: Create the FlexReport
Use the following Report Query to create a FlexReport:
{
"sqlStatement" :
" SELECT
timeInterval_Month AS Month,
ROUND(SUM(CostInBillingCurrency), 2) AS PartnerCost,
ROUND(
CASE
WHEN PricingModel IN ('SavingsPlan', 'Reservation', 'Spot') THEN SUM(CostInBillingCurrency)
WHEN PricingModel = 'OnDemand' THEN SUM(PaygCostInBillingCurrency)
ELSE SUM(PaygCostInBillingCurrency)
END,
2
) AS CustomerCostInPayG,
ROUND(
(
CASE
WHEN PricingModel IN ('SavingsPlan', 'Reservation', 'Spot') THEN SUM(CostInBillingCurrency)
WHEN PricingModel = 'OnDemand' THEN SUM(PaygCostInBillingCurrency)
ELSE SUM(PaygCostInBillingCurrency)
END
) - SUM(CostInBillingCurrency),
2
) AS PartnerMargin,
SUM(Quantity) AS SUM_Quantity,
ELEMENT_AT (azure_AdditionalInfo_Map, 'servicetype') AS ServiceType,
Lower(ResourceLocation) AS ResourceLocation,
MeterCategory AS MeterCategory,
Term AS RIorASP_Term,
BenefitName AS RIorASP_Name,
SubscriptionName AS SubscriptionName,
SubscriptionId AS SubscriptionId,
ResourceGroup AS ResourceGroupName,
PricingModel AS PricingModel,
ChargeType AS ChargeType,
COALESCE(
CASE
WHEN perspective.\"Azure Partner Customers\" IS NULL THEN 'Asset Not Allocated'
WHEN perspective.\"Azure Partner Customers\" = 'Other' THEN 'Asset Not Allocated'
ELSE perspective.\"Azure Partner Customers\"
END,
'Asset Not Allocated'
) AS AzureCustomerName
FROM
AZURE_COST_USAGE
WHERE
(MetricType LIKE '%Amortized%')
and (AccountType IN ('MCA'))
GROUP BY
timeInterval_Month,
MetricType,
PricingModel,
ELEMENT_AT (azure_AdditionalInfo_Map, 'servicetype'),
lower(ResourceLocation),
MeterCategory,
Term,
BenefitName,
SubscriptionName,
SubscriptionId,
ResourceGroup,
AccountType,
ChargeType,
perspective.\"Azure Partner Customers\" ",
"needBackLinkingForTags" : true ,
"dataGranularity" : "MONTHLY" ,
"timeRange" : {
"last": 12
} ,
"limit" : -1
}
Step 3: Update Chart View in the FlexReport