Forum Discussion

warabimochi's avatar
warabimochi
Regular Visitor
1 year ago
Solved

Sum values for each category

Hi, I am new to PBI and I would like to know how to derive the number of orders placed for each fruit using DAX.   Customer  ID Order Date Fruit   quantity OrderCount 1 0...
  • Jihwan_Kim's avatar
    1 year ago

    Hi,

    I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

     

     

     

     

     

    Order count: = 
    SUMX (
        VALUES ( Fruit[Fruit] ),
        COUNTROWS (
            CALCULATETABLE (
                FILTER (
                    SUMMARIZE ( Data, Data[Customer  ID], Data[Order Date], Data[quantity] ),
                    Data[quantity] > 0
                )
            )
        )
    )