Forum Discussion

K4rL0L's avatar
K4rL0L
Advocate II
8 years ago

DAX ABC Analysis

Hey,

I used https://www.daxpatterns.com/abc-classification-dynamic/ to build the ABC analysis.
I am working with customers and sales. The analysis works but is not exact. Out of 953 users 8 are missing and their sales too.
The rows missing are seemingly random or maybe are saved next to each other on the hard drives, don't know. But they don't have a connection to each other in any other way (Customer, Salesamount, Sale day, sale month, product... ).
The data ist just about the last 3 years and even then not even a million rows. With a slicer i am viewing different years and the numbers missing change from year to year, but they are always the same customers and sales.
Does anyone have an idea why they are missing?

 

ABCUmsatz =

CALCULATE(
    [Gesamtumsatz];
    VALUES(rpt_VK_Historie[KNDNR]);
    FILTER(
        CALCULATETABLE(
            ADDCOLUMNS(
                ADDCOLUMNS(
                    VALUES(rpt_VK_Historie[KNDNR]);
                    "Äußerer Wert"; [Gesamtumsatz]
                                         );
                                   "ZusammengefügterUmsatzProzent"; DIVIDE(
                                   SUMX(
                                             FILTER(
                                                        ADDCOLUMNS(
                                                                                  VALUES(rpt_VK_Historie[KNDNR]);
                                                                                 "Innerer Wert"; [Gesamtumsatz]
                                                                                );
                                                       [Innerer Wert] >= [Äußerer Wert]
                                                       );
                                          [Innerer Wert]
                                          );
                            CALCULATE(
                                                [Gesamtumsatz];
                                                VALUES(rpt_VK_Historie[KNDNR])
                                               )
                                   )
                              );
              ALL(rpt_VK_Historie)
              );
            [ZusammengefügterUmsatzProzent] > [MinUntereGrenze]
            && [ZusammengefügterUmsatzProzent] <= [MaxObereGrenze]
    )
)




Thanks for your help :)

2 Replies

  • Ok i figured it out. Now i am using Customer groups and Sales. For some reason that works correctly. And if i need the customers it is no problem to just display those out of  the customergroups.

    • K4rL0L's avatar
      K4rL0L
      Advocate II

      Nevermind. The values are corrct again but if a customer is in group A B or C depends now on which customers group he is in. Not exactly what i was looking for.