Forum Discussion
mc_gadhzalova
2 years agoRegular Visitor
NUMERIC DISTRIBUTION - MEASURE ISSUE
Hi All,
I have been struggling to create a measure to calculate numeric distribution.
I need measure/s that calculate if a brand is avaliable in a store and then compared to the total number stores.
My data is structured as it follows:
| COUNTRY | MONTH | STORE | BRAND | ITEM | EXISTS |
| BG | 1 | X | ENERGY DRINK | CLASSIC FLAVOUR | 1 |
| BG | 1 | X | ENERGY DRINK | APPLE FLAVOUR | 0 |
| BG | 1 | X | COFFEE | LATTE | 0 |
| BG | 1 | Y | ENERGY DRINK | CLASSIC FLAVOUR | 0 |
| BG | 1 | Y | ENERGY DRINK | APPLE FLAVOUR | 0 |
| BG | 1 | Y | COFFEE | LATTE | 1 |
| BG | 2 | X | ENERGY DRINK | CLASSIC FLAVOUR | 1 |
| BG | 2 | X | ENERGY DRINK | APPLE FLAVOUR | 1 |
| BG | 2 | X | COFFEE | LATTE | 1 |
| BG | 2 | Y | ENERGY DRINK | CLASSIC FLAVOUR | 0 |
| BG | 2 | Y | ENERGY DRINK | APPLE FLAVOUR | 0 |
| BG | 2 | Y | COFFEE | LATTE | 0 |
The logic is if there is atlest 1 item from each brand that exists in store, that there is brand distribution.
And my desired outcome logic is here:
| COUNTRY | MONTH | STORE | BRAND | BRAND DISTRIBUTION |
| BG | 1 | X | ENERGY DRINK | 1 |
| BG | 1 | X | COFFEE | 0 |
| BG | 1 | Y | ENERGY DRINK | 0 |
| BG | 1 | Y | COFFEE | 1 |
| BG | 2 | X | ENERGY DRINK | 1 |
| BG | 2 | X | COFFEE | 1 |
| BG | 2 | Y | ENERGY DRINK | 0 |
| BG | 2 | Y | COFFEE | 0 |
I managed to reach this result with the use of the formula SUMMARIZE, but i couldn't move forward from this result to reach my desired calculation.
Also, my dataset is very large and copying the whole data and grouping in it Power Query isn't an option.
Thank you very much in advance!
Michaela