Forum Discussion
Banding, Bucketing or Segmentation Problem
Hi All,
I have two tables where I want to get true or false as shown as output in table2. Based on the price range after three column matches, result should be thrown. I have tried the below method as shown in the link. However I had no luck because it shows nothing not even the error.
Thanks in advance, please help.
Below are the tables:
Table1
| Fruit Name | Type | Start Price | End Price |
| Orange | Type-1 | 1 | 5 |
| Orange | Type-2 | 6 | 10 |
| Orange | Type-3 | 11 | 15 |
| Apple | Type-1 | 1 | 6 |
| Apple | Type-2 | 7 | 10 |
| Apple | Type-3 | 11 | 14 |
| Grapes | Type-1 | 1 | 4 |
| Grapes | Type-2 | 5 | 9 |
| Grapes | Type-3 | 10 | 15 |
Table2
| Fruit Name | Type | Price Sold | Price Range Check |
| Orange | Type-2 | 6 | TRUE |
| Apple | Type-3 | 7 | FALSE |
| Grapes | Type-1 | 4 | TRUE |
| Orange | Type-1 | 3 | TRUE |
| Orange | Type-3 | 5 | FALSE |
| Apple | Type-1 | 8 | FALSE |
| Grapes | Type-2 | 2 | FALSE |
| Grapes | Type-3 | 14 | TRUE |
| Oranges | Type-1 | 6 | FALSE |
Try a new column in table 2. If required adjust the filter as per need
Price Range Check = if(isblank(countx(filter(table1,table1[Fruit Name]=table2[Fruit Name] && table1[Type]=table2[Type] && table1[Start Price]<=table2[Price Sold] && table1[End Price]>=table2[Price Sold]),table1[Fruit Name])),"False","True")Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
2 Replies
- amitchandakSuper User
Try a new column in table 2. If required adjust the filter as per need
Price Range Check = if(isblank(countx(filter(table1,table1[Fruit Name]=table2[Fruit Name] && table1[Type]=table2[Type] && table1[Start Price]<=table2[Price Sold] && table1[End Price]>=table2[Price Sold]),table1[Fruit Name])),"False","True")Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin- labuser1235Helper IV
amitchandak Awesome, worked like charm. Thank you so much, You are the best 🙂