Forum Discussion
Adding counts together from different columns with different filters
- 2 years ago
Hello! You would create measures to handle this. Let's say you have a table with store numbers, sku sold, date, units sold and $ sold, but you want to know how many skus any given store sold for category A and B and you want to know how many for C & D, and you want to know the total of those.
Ideally, you will have a dim_store_list table that has all the details about the store numbers (address, city, state, phone, etc), a dim_date_table (date, month number, month name, quarter, week number, etc.), a dim_products table (sku number, sku description, category, brand, sub-category, sub-brand, etc). These tables would be joined to the fact_sales table I mentioned in the first paragraph.
You could then make a measure that would be for sales (Sales = SUM('YourTable'[Sales]), then you could create the first filtered measure; for my example, I just want to see the sum of sales for Bikes and Accessories
Sales (Bikes and Accessories) =CALCULATE([Sales],'Product'[Category] IN { "Accessories", "Bikes" })You would do the same for the second set of conditions you have, then you would make a measure to add these two measures together.
Hello! You would create measures to handle this. Let's say you have a table with store numbers, sku sold, date, units sold and $ sold, but you want to know how many skus any given store sold for category A and B and you want to know how many for C & D, and you want to know the total of those.
Ideally, you will have a dim_store_list table that has all the details about the store numbers (address, city, state, phone, etc), a dim_date_table (date, month number, month name, quarter, week number, etc.), a dim_products table (sku number, sku description, category, brand, sub-category, sub-brand, etc). These tables would be joined to the fact_sales table I mentioned in the first paragraph.
You could then make a measure that would be for sales (Sales = SUM('YourTable'[Sales]), then you could create the first filtered measure; for my example, I just want to see the sum of sales for Bikes and Accessories