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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Khramana
Frequent Visitor

Word in Column count: unique and percentage

Hello Power BI masters!

I have a table "All devices", in which I have columns with device names bu users like this:

User nameDevice model
AlexSamsung A3
HeleneSamsung A1
JorgeApple 13
OlgaApple 13
RobertNokia 3310

My goal is to understand % of each model in device park like:
Samsung A3 - 20%
Samsung A1 - 20%
Apple13 - 40%
Nokia 3310 - 20%

Could you please help with correct measure syntax?
I understand that it's easier to have a static list of possible models, but it's not my way because it changes constantly...

*I also have another table that shows me the number of specific applicaton crashes on each user device.
Further I would need to compare "% of crashes by device model/all crash cases" with "% of device model/whole device models park"...
Hence, I'm looking for advice how to calculate % of models in park better so I could use the result then in next actions.

Could you please advice?

3 REPLIES 3
m_dekorte
Super User
Super User

Hi @Khramana,

 

You can leverage a Table.RowCount and Table.Group for that.

Copy this code into a new blank query

let
    TotalRows = Table.RowCount( Source ),
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcsxJrVDSUQpOzC0uzUtXcDRWitWJVvJIzUnNS0UWNwSLe+UXpYOEHQsKclIVDCGK/XPSE9HFgvKTUotKgKJ++dmZiQrGxoYGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"User name" = _t, #"Device model" = _t]),
    GroupPerc = Table.Group(Source, {"Device model"}, {{"Count", each Table.RowCount(_)/TotalRows, Percentage.Type}})
in
    GroupPerc

 

First I added a TotalRows = Table.RowCount( Source ),

Then you can use Group By on the ribbon, as key set Device Model

And for the aggregation select Count Rows, update the code in the formula bar.

 

Table.Group(Source, {"Device model"}, {{"Count", each Table.RowCount(_) /TotalRows, Percentage.Type}})

 

With this result

m_dekorte_0-1684249101918.png

 

Ps. If this helps solve your query please mark this post as Solution, thanks!

Hello @m_dekorte !
Thank you for the reply!
Let me try to do it.
Could you please give a clue what does this value mean in your measure? So I could understand and use it then also
I mean this part: i45WcsxJrVDSUQpOzC0uzUtXcDRWitW....

@Khramana 

LOL that's binary, the UI generates it automatically when you select "Enter Data" on the ribbon and create a table on the fly.

 

Hope that clarifies it.

Also please do not forget to mark the post that helped solve your query, as Solution.

 

Cheers

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.