Forum Discussion
Rookarumba
8 years agoHelper III
Bayes Model (PowerQuery or Dax)
Hello Everyone Here, I'm hoping someone is able to help me solve a few questions on a Data Model I'm working on which are Mutually Exclusive :) Basically here are the conditions; 1) Each Custom...
v-yulgu-msft
8 years agoMicrosoft Employee
Hi Rookarumba,
Please create calculated columns via DAX
Population split via Item Segmentation =
IF (
CALCULATE (
DISTINCTCOUNT ( Test_1[Item Code Classification] ),
ALLEXCEPT ( Test_1, Test_1[Customer Segmentation], Test_1[Item Segmentation] )
)
> 1,
Test_1[Population] * 0.5,
Test_1[Population] * 1
)
Population split via Item Code Classification =
Test_1[Population split via Item Segmentation]
/ CALCULATE (
DISTINCTCOUNT ( Test_1[Item Code Classification] ),
ALLEXCEPT ( Test_1, Test_1[Customer Segmentation], Test_1[Item Segmentation] )
)
/ CALCULATE (
DISTINCTCOUNT ( Test_1[Item Code] ),
ALLEXCEPT (
Test_1,
Test_1[Customer Segmentation],
Test_1[Item Segmentation],
Test_1[Item Code Classification]
)
)
Best regards,
Yuliana Gu
- Rookarumba8 years agoHelper III
v-yulgu-msft, Thanks for the solution but I might have oversimplified my original question.
I've print screen another scenario, whereby there a total of 8 rows and 4 sets.
I try to troubleshoot and found out that;
Population split via Item Segmentation = IF ( CALCULATE ( DISTINCTCOUNT ( Test_1[Item Code Classification] ), ALLEXCEPT ( Test_1, Test_1[Customer Segmentation], Test_1[Item Segmentation] ) )Give me a count of 2, instead of 4.
I tried to run it in PowerQuery too, via Groupby "Customer Segmentation", "Item Segmentation", "Population", and distinct count rows.
And I got a count of 2 instead of 4 too.
The rest seems fine except for this part, I can't figure it out whats going on...
Appreciate it again :)