Forum Discussion

reddeppag's avatar
reddeppag
Frequent Visitor
8 years ago
Solved

DAX - Grouping on multiple columns and the count

I have a DB table which has data as the following:

Please help on the below task asap.

Input Data  Output Data
 AreaElement  Result  
H.0100H.0100.01.01.01   AreaElementRequired Result
H.0100H.0100.01.01.01  H.0100H.0100.01.01.014
H.0100H.0100.01.01.01  H.0100H.0100.01.01.022
H.0100H.0100.01.01.01  H.0130H.0130.01.033
H.0100H.0100.01.01.02  H.0130H.0130.04.015
H.0100H.0100.01.01.02     
H.0130H.0130.01.03     
H.0130H.0130.01.03     
H.0130H.0130.01.03     
H.0130H.0130.04.01     
H.0130H.0130.04.01     
H.0130H.0130.04.01     
H.0130H.0130.04.01     
H.0130H.0130.04.01     

 

Thank a Lot!!!

  • I got the solution on the below question NumberOfOpenPO's = CALCULATE ( COUNTROWS ( VendorData), ALLEXCEPT ( VendorData,VendorData[Delivery Area], VendorData[WBS Element],VendorData[Agebucket]) ) Happy Coding!!!!!!!!!!!

3 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi reddeppag,

     

    Two ways for your reference.

     

    1. Create a calculated table like below.

    Output =
    SUMMARIZE (
        Input,
        Input[Area],
        Input[Element],
        "Count value", COUNT ( Input[Element] )
    )

     

     

    2. Based on your Input table, create a measure.

    Required result = COUNT(Input[Element])

     

    Then, in report view, insert a table visual, directly add above measure into visual.

     

    Best regards,
    Yuliana Gu

  • reddeppag's avatar
    reddeppag
    Frequent Visitor
    I got the solution on the below question NumberOfOpenPO's = CALCULATE ( COUNTROWS ( VendorData), ALLEXCEPT ( VendorData,VendorData[Delivery Area], VendorData[WBS Element],VendorData[Agebucket]) ) Happy Coding!!!!!!!!!!!