Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Order buckets using Analysis Services

Hello Community,   In Power BI, I want to create a column chart with the count of awarded orders on the x-axis, and the count of suppliers on the y-axis. The count of orders should be presented as ...
  • lkalawski's avatar
    5 years ago

    Anonymous

    I checked again and you can do this in this way:

    Given this data structure:

     

    you need to create a calculated table using this DAX code:

    Customer Orders = 
    SUMMARIZE(
        'Table',
        'Table'[SupplierID],
        "Count of Orders",
        COUNTROWS(VALUES('Table'[OrderID]))
    )

     

    You will receive calculations of how many orders each supplier had. Then we will create groups (buckets):

    Buckets = 
    SWITCH(TRUE(),
    'Customer Orders'[Count of Orders] < 2, "<2",
    'Customer Orders'[Count of Orders] >= 2 && 'Customer Orders'[Count of Orders] <= 5, "2-5",
    ">5")

     

    Thanks to this, you will get groups that you can use in the chart. Put Buckets on the x-axis, and add SupplierID as Value and change it to Count, or write measure for Count for Suppliet ID and put it in Value field.

     

    If you have any problems, ask.



    _______________
    If I helped, please accept the solution and give kudos! 😀