cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
XTF_2020
Helper I
Helper I

Count column calculated by group

Hello everyone,

I have a column with four groups and I wanted to create another column to have a count indicator in each group of this column.

 

Capture.JPG

How can I do that?

 

My dataset

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vRTMDayVNJRUorVIZFnYmQA5zkpGBmbEMkzNjCgKQ/VZZTzYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Group = _t, #"Cont by Group" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Group", type text}, {"Cont by Group", type text}})
in
#"Changed Type"

 

 

 

1 ACCEPTED SOLUTION
AlB
Super User III
Super User III

Hi @XTF_2020 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vRTMDayVIrVIY5pYmQAYTopGBmb4GcaGxhQi4lkMRnMWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Group = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Group"}, {{"Cont by Group", each List.Numbers(1,Table.RowCount(_))}}),
    #"Expanded Cont by Group" = Table.ExpandListColumn(#"Grouped Rows", "Cont by Group")
in
    #"Expanded Cont by Group"

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User III
Super User III

Hi,

Refer to the solution offered by ImkeF here - Solved: Custom column Index or Ranking by other column - Microsoft Power BI Community.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
AlB
Super User III
Super User III

Hi @XTF_2020 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vRTMDayVIrVIY5pYmQAYTopGBmb4GcaGxhQi4lkMRnMWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Group = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Group"}, {{"Cont by Group", each List.Numbers(1,Table.RowCount(_))}}),
    #"Expanded Cont by Group" = Table.ExpandListColumn(#"Grouped Rows", "Cont by Group")
in
    #"Expanded Cont by Group"

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.