Dear Dax Pro's
i have a Case my DAX Knowledge exceeds. I have a Dataset, and i want to use the ALLEXCEPT in a more complex way.
[TABLE="width: 902"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Customer_id[/TD]
[TD]Order_of_n_day[/TD]
[TD]OrderDay[/TD]
[TD]Revenue[/TD]
[TD]Date[/TD]
[TD]Order no[/TD]
[TD]Category[/TD]
[TD]MaxCategory
[/TD]
[TD]Revenue_of_max_category
[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885689[/TD]
[TD]V[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]22,36[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885690[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]49,19
[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885691
[/TD]
[TD]P[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]18,02[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885692[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]108,4[/TD]
[TD="align: right"]01.09.2015 00:00[/TD]
[TD="align: right"]885693[/TD]
[TD]S[/TD]
[TD]S[/TD]
[TD="align: right"]108,4[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885694[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]60,17[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885695[/TD]
[TD]P[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885696[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]200
[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885697[/TD]
[TD]V[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]22,36[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885698[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885699[/TD]
[TD]P[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]18,02[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885700[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]01.10.2015 00:00[/TD]
[TD="align: right"]885701[/TD]
[TD]S[/TD]
[TD]S[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885702[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]227[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]60,17[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885703[/TD]
[TD]P[/TD]
[TD]V[/TD]
[TD="align: right"]227[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885704[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]227
[/TD]
[/TR]
</tbody>[/TABLE]
All is given except
[TABLE="width: 902"]
<tbody>[TR]
[TD]MaxCategory
[/TD]
[TD]Revenue_of_max_category
[/TD]
[/TR]
</tbody>[/TABLE]
-My Problem is, I want to find for each Customer the Category with the highest Revenue on the Order Day, flag all other with that Category and also want to know that Revenue.
-The other Problem is, if there has been 2 Orders of the same category on that day, it should be summarized first in the calculation (Highest revenue of that Category of the day per Customer).
Is this even possible in DAX in a performant way? ALLEXCEPT and EARLIER worked pretty fast for me so far. Maybe it's more a "SQL Rank over Partition by" thing
Thank you guys in advance! You are the best!
i have a Case my DAX Knowledge exceeds. I have a Dataset, and i want to use the ALLEXCEPT in a more complex way.
[TABLE="width: 902"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Customer_id[/TD]
[TD]Order_of_n_day[/TD]
[TD]OrderDay[/TD]
[TD]Revenue[/TD]
[TD]Date[/TD]
[TD]Order no[/TD]
[TD]Category[/TD]
[TD]MaxCategory
[/TD]
[TD]Revenue_of_max_category
[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885689[/TD]
[TD]V[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]22,36[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885690[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]49,19
[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885691
[/TD]
[TD]P[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]18,02[/TD]
[TD="align: right"]29.07.2015 00:00[/TD]
[TD="align: right"]885692[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]49,19[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]108,4[/TD]
[TD="align: right"]01.09.2015 00:00[/TD]
[TD="align: right"]885693[/TD]
[TD]S[/TD]
[TD]S[/TD]
[TD="align: right"]108,4[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885694[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]60,17[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885695[/TD]
[TD]P[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]07.11.2016 00:00[/TD]
[TD="align: right"]885696[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]127[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]200
[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885697[/TD]
[TD]V[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]22,36[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885698[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885699[/TD]
[TD]P[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]18,02[/TD]
[TD="align: right"]29.08.2015 00:00[/TD]
[TD="align: right"]885700[/TD]
[TD]F[/TD]
[TD]P[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]01.10.2015 00:00[/TD]
[TD="align: right"]885701[/TD]
[TD]S[/TD]
[TD]S[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885702[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]227[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]60,17[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885703[/TD]
[TD]P[/TD]
[TD]V[/TD]
[TD="align: right"]227[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]17.11.2016 00:00[/TD]
[TD="align: right"]885704[/TD]
[TD]V[/TD]
[TD]V[/TD]
[TD="align: right"]227
[/TD]
[/TR]
</tbody>[/TABLE]
All is given except
[TABLE="width: 902"]
<tbody>[TR]
[TD]MaxCategory
[/TD]
[TD]Revenue_of_max_category
[/TD]
[/TR]
</tbody>[/TABLE]
-My Problem is, I want to find for each Customer the Category with the highest Revenue on the Order Day, flag all other with that Category and also want to know that Revenue.
-The other Problem is, if there has been 2 Orders of the same category on that day, it should be summarized first in the calculation (Highest revenue of that Category of the day per Customer).
Is this even possible in DAX in a performant way? ALLEXCEPT and EARLIER worked pretty fast for me so far. Maybe it's more a "SQL Rank over Partition by" thing
Thank you guys in advance! You are the best!