Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
seanrm42
Frequent Visitor

Consolidated Count

Hello fellow PBIX users.

 

I need your help for an executive request that I know is simple but has me stumped.

 

I have a large table which has a DeviceID and the AppID. For each App the Device has installed there is a row.

 

Example:

 

Device 1        App1

Device 2        App1

Device 2        App2

Device 2        App3

Device 3        App2

 

I need a summarized view that lookcs like this:

 

Count of Apps        Count of Device 

1                             2

3                             1

 

Showing the number of devices which have have a certain counts of the apps. We want to start with the devices which have the most apps installed and work our way back.

1 ACCEPTED SOLUTION

@seanrm42

 

Try this calculated Table

 

New Table =
SUMMARIZE (
    SUMMARIZE (
        TableName,
        TableName[Devices],
        "Count of Apps", COUNT ( TableName[Apps] )
    ),
    [Count of Apps],
    "Count of devices", COUNT ( TableName[Devices] )
)

View solution in original post

10 REPLIES 10
Yggdrasill
Responsive Resident
Responsive Resident

SummarizedTable = SUMMARIZE( Table1 ;
    Table1[DeviceID];
    "#ofDev" ; DISTINCTCOUNT( Table1[DeviceID] ) ;
    "#ofApps" ; COUNTROWS( Table1 ) 
)   

Then create a group from "#ofApps" and size of the bin is just 1Capture3.PNGCapture4.PNG

 

Capture2.PNG

Which of the new tables (Apps or Devices) does 'Table 1' represent in your formula?

 

When I created your formula I got 3 columns instead of 1.

Table 1 is exactly like your example and you should have 3 columns

@seanrm42

 

Try this calculated Table

 

New Table =
SUMMARIZE (
    SUMMARIZE (
        TableName,
        TableName[Devices],
        "Count of Apps", COUNT ( TableName[Apps] )
    ),
    [Count of Apps],
    "Count of devices", COUNT ( TableName[Devices] )
)
dramus
Continued Contributor
Continued Contributor

I would do it with two summary tables.

 

Devices = SUMMARIZE('Devices and Apps',[Device],"# of Apps",count('Devices and Apps'[App]))
Apps = SUMMARIZE('Devices and Apps',[App],"# of Devices",count('Devices and Apps'[Device]))

You can then join these to the main data table.

 

devices and apps.PNG

I created the two tables but am having a struggle getting to the finalized summary view my executive is looking for.

 

He wants to know how many devices have 1 app, how many devices have 2 apps, how many devices have 3 apps. and so on. The maximum number is 17 and I've compiled the data in excel wiht a pivot table just want it to refresh automatically in PBI from the data source directly.

dramus
Continued Contributor
Continued Contributor

Given this data:

devices and apps.PNG

You want this result:

Capture.PNG

 

To get this I took the [# of Apps] (not summarized) and the count distinct [Device] from the 'Devices' table.

 

I think I am missing this step:

 

"You can then join these to the main data table."

 

Is this a union in DAX or a merge in the tables and if so which tables merging on what?

 

Sorry for all the questions but I greatly appreciate the help.

dramus
Continued Contributor
Continued Contributor

"You can then join these to the main data table."

 

Is this a union in DAX or a merge in the tables and if so which tables merging on what?

 

I mean create relationships between your original table and the two new summary tables.

 

relationship.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.