Forum Discussion
sku categorization
hi team
i have a requirement of categorizing each sku as high and low based on target sales.
So i have 2 tables - first one is order table where i have order details at line item which has sku data-
| Year | SKU | Category | Country | Sales | Level |
| 2020 | 1 | Apple | USA | 10 | |
| 2020 | 2 | Ball | UAE | 20 | |
| 2020 | 3 | Apple | UAE | 30 | |
| 2021 | 4 | Ball | UK | 40 | |
| 2021 | 2 | CLutch | USA | 10 | |
| 2021 | 1 | Apple | UAE | 30 | |
| 2021 | 6 | clutch | UK | 40 |
Now i have another Target table as below
| year | category | country | Target |
| 2020 | Apple | USA | 15 |
| 2020 | Apple | UAE | 20 |
| 2020 | Apple | UK | 5 |
| 2020 | Ball | USA | 10 |
| 2020 | Ball | UAE | 25 |
| 2020 | Ball | UK | 15 |
| 2020 | Clutch | USA | 20 |
| 2020 | Clutch | UAE | 30 |
| 2020 | Clutch | UK | 35 |
| 2021 | Apple | USA | 10 |
| 2021 | Apple | UAE | 25 |
| 2021 | Apple | UK | 15 |
| 2021 | Ball | USA | 10 |
| 2021 | Ball | UAE | 25 |
| 2021 | Ball | UK | 15 |
| 2021 | Clutch | USA | 20 |
| 2021 | Clutch | UAE | 30 |
| 2021 | Clutch | UK | 35 |
now i want to create a column which will give categorize each sku as high or low based on whether they are high or low on compasison with target
Expected output-
| Year | SKU | Category | Country | Sales | level |
| 2020 | 1 | Apple | USA | 10 | low |
| 2020 | 2 | Ball | UAE | 20 | low |
| 2020 | 3 | Apple | UAE | 30 | high |
| 2021 | 4 | Ball | UK | 40 | high |
| 2021 | 2 | CLutch | USA | 10 | low |
| 2021 | 1 | Apple | UAE | 30 | high |
| 2021 | 6 | clutch | UK | 40 | high |
Please help me with the dax for the same and also on relationships as there can be only one relationship
even that relationship is going to be many to many
2 Replies
- ThxAlotSuper User
- AnonymousNot applicable
hi
the thing here is that category and country information are in a different dimension table and are related the sales table by a primary key
instead of putting category table name is showing an error table having multiple values and cant find a simgle value
on using max (category table name) is not giving the correct output