Forum Discussion
Filter calculation in a measure
- Anonymous1 year ago
Thank you very much bhanu_gautam for your prompt reply.
For your question, here is the method I provided:
Here's some dummy data
“CapeTown_itemwisesales”
“PromoList”
Add a calculated column in the CapeTown_itemwisesales table to indicate whether an item is on promotion:
IsPromo = IF(RELATED('PromoList'[ItemCode]) <> BLANK(), 1, 0)Create a measure to calculate the total promo sales:
PromoSales = CALCULATE(SUM('CapeTown_itemwisesales'[TotalSales]), 'CapeTown_itemwisesales'[IsPromo] = 1)Create a measure to calculate the total sales:
Measure TotalSales = SUM('CapeTown_itemwisesales'[TotalSales])Create a measure to calculate the percentage of promo sales versus total sales:
PromoSalesPercentage = DIVIDE([PromoSales], [Measure TotalSales], 0)Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I dont have it in the same sales report, its a completelt different list in which i only have the item codes that are participating in the promo, no sales values, is there a way for me to link the sales data to the promo list so that it can maybe add a column in the sales data for Promos?