Forum Discussion

imprabhu's avatar
imprabhu
Regular Visitor
2 years ago
Solved

Vendor Group formula

I have a table in PBI visualization that includes vendors from the table Vendor , budget from the table Budget, revenue from the table Revenue , Todo (measure), and FY23 (measure), i want to include the top 10 vendors based on revenue, and in the balance of vendors, i need to include the top 5 vendor from ToDo(who are not in the to 10 revenue) and all other vendors need to be grouped as "All Others". Kindly suggest a dax formula that is available in the visualization.


VendorBudgetRevenueTodo FY23 
Vendor1        15,080,001        4,092,813        10,987,188        17,672,853
Vendor2          9,879,999        1,901,637          7,978,362        15,360,947
Vendor3          7,280,001           410,611          6,869,390        10,848,157
Vendor4          3,639,999        6,251,307-         2,611,308          5,117,853
Vendor5          2,600,001        1,105,942          1,494,059          2,628,684
Vendor6          1,040,001        1,558,555-            518,554          3,447,728
Vendor7              909,999           796,878              113,121              961,381
Vendor8              519,999                      -                519,999 
Vendor9              519,999           847,236-            327,237              776,538
Vendor10              390,000                   355              389,645          1,111,154
Vendor11          1,623,000           123,000          1,500,000                  5,068
Vendor12          1,252,934             52,934          1,200,000              694,784
Vendor13          1,130,000           1,130,000                         -  
Vendor14          1,211,123171123          1,040,000              172,581
Vendor15              890,000 890000              126,067
All Others          2,082,050           189,550     1,892,500.00          1,221,700
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  imprabhu ,

     

    Here are the steps you can follow:

    1. Create measure.

    Revenue_10 =
    IF(
        MAX('Table'[Vendor])="All Others",BLANK(),
    RANKX(
        FILTER(ALL('Table'),'Table'[Vendor]<>"All Others"),
        CALCULATE(SUM('Table'[Revenue])),,DESC,Dense))
    Todo_5 =
    IF(
        [Revenue_10] <=10 ||[Revenue_10]=BLANK(),BLANK(),
        RANKX(
            FILTER(ALL('Table'),
            [Revenue_10]> 10 ),[Todo],,DESC,Dense))

    2. Click [Todo_5] in Visual's Filter, -- not blank.

    3. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

2 Replies

  • Please provide sample data that fully covers your issue (ie more than 15 rows, and without the preaggregation of "All Others").
    Please show the expected outcome based on the sample data you provided.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  imprabhu ,

     

    Here are the steps you can follow:

    1. Create measure.

    Revenue_10 =
    IF(
        MAX('Table'[Vendor])="All Others",BLANK(),
    RANKX(
        FILTER(ALL('Table'),'Table'[Vendor]<>"All Others"),
        CALCULATE(SUM('Table'[Revenue])),,DESC,Dense))
    Todo_5 =
    IF(
        [Revenue_10] <=10 ||[Revenue_10]=BLANK(),BLANK(),
        RANKX(
            FILTER(ALL('Table'),
            [Revenue_10]> 10 ),[Todo],,DESC,Dense))

    2. Click [Todo_5] in Visual's Filter, -- not blank.

    3. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly