Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi everyone,
Is there a solution to convert below measure to a calculated column?
ABC Classification =
IF(
// Check if there is only one product selected
HASONEVALUE('Product'[Item]),
// Calculate total sales for all selected products
VAR AllSales = CALCULATE(
[Total Quantity L12M],
ALLSELECTED('Product')
)
// Store the current total sales amount
VAR CurrentSalesAmount = [Total Quantity L12M]
// Calculate cumulative sales for products with sales amount greater than or equal to the current sales amount
VAR CumulatedSales = CALCULATE(
[Total Quantity L12M],
FILTER(
ALL('Product'),
[Total Quantity L12M] >= CurrentSalesAmount
)
)
// Calculate the current cumulative percentage of sales
VAR CurrentCumulatedPercent = DIVIDE(
CumulatedSales,
AllSales
)
// Return ABC classification based on cumulative percentage
RETURN
SWITCH(
TRUE(),
ISBLANK(CurrentCumulatedPercent), BLANK(), // If there is no sales data, return blank
CurrentCumulatedPercent < 0.8, "A", // If cumulative percent is less than 0.8, classify as "A"
CurrentCumulatedPercent <= 0.95, "B", // If cumulative percent is less than or equal to 0.95, classify as "B"
"C" // Otherwise, classify as "C"
)
)
Thank you in advance!
Hi @DM_95
@lbendlin , thanks for your concern about this case.
I couldn't test it without any data. Could you please provide me with sample data and the results based on these sample data? That would be very helpful. [Total Quantity L12M] looks like a measure, could you please give the calculation of the formula?
Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Yulia Xu
You cannot create a calculated column from a filter selection.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |