Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

I need to group data by version.

Hi,

I need to group data below in screen shot.  i have two columns  application and version columns in table. 

 

here one applictaions have many versions and one version have many devices listed.  I need outputs like application, version and  Devices total count.

application ID versioncount 
commicrosoft.officeoutlookIOS4.3.1 (2915218)1000
commicrosoft.officeoutlookIOS4.2125.0 (9055108)150
commicrosoft.officeoutlookAndroid4.0.533000
commicrosoft.officeoutlookAndroid3.0.55500

 

Here there are multiple versions and one versions have multiple devices connected. I need the count of devices for each version.

  • Hi Anonymous ,

    You can update your code with below.

    Count_of_app_ver = 
    CALCULATE (
        COUNTROWS ( version_data ),
        FILTER (
            version_data,
            version_data[applicationversion] = MAX ( version_data[applicationversion] )
                && (version_data[mamapplicationid] in  {"com.microsoft.andriod","com.microsoft.powerpoint" } )
        )

     

    Thanks,

    Samarth

3 Replies

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

     

    You can create a measure with below code:-

     

    Count_of_app_ver =
    CALCULATE (
        COUNTROWS ( version_data ),
        FILTER (
            version_data,
            version_data[applicationversion] = MAX ( version_data[applicationversion] )
                && version_data[mamapplicationid] = MAX ( version_data[mamapplicationid] )
        )
    )

     

    My data table:-

    Output:-

     

    Thanks

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      If i want to filter the measure to get data only for com.microsoft.andriod and com.microsoft.powerpoint.

       

      how to do it.

      • Samarth_18's avatar
        Samarth_18
        Icon for Community Champion rankCommunity Champion

        Hi Anonymous ,

        You can update your code with below.

        Count_of_app_ver = 
        CALCULATE (
            COUNTROWS ( version_data ),
            FILTER (
                version_data,
                version_data[applicationversion] = MAX ( version_data[applicationversion] )
                    && (version_data[mamapplicationid] in  {"com.microsoft.andriod","com.microsoft.powerpoint" } )
            )

         

        Thanks,

        Samarth