Forum Discussion
Count occurrence
- 6 years ago
Hi bednarol
In my first solution of the previous reply, i use "Group" function, but it would not change the data model,
please note, i add two "operations",
one is "count"(count rows) based on "program" column,
another is "all"(don't summarized), it means it would be the original columns.
then i get two columns, one is "count", another is "all",
in "all" column, there are all my original columns nested here,
i click on "expand" icon from the "all" column and select columns i need, i can get all original columns.
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi bednarol
In Edit queries, you can group rows and add a count column.
Or, create a calculated column in Data model view,
Column = CALCULATE(COUNT('Table'[program]),ALLEXCEPT('Table','Table'[program]))
Maggie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Grouping is obvious but I do not want to do that because I need to keep the table ungroup for futher data manipulation. Using the calculated column in Desktop in a good idea but I cannot figure out how to do that in Excel Power Query. Maybe that is one of the limitation?
- v-juanli-msft6 years agoCommunity Support
Hi bednarol
In my first solution of the previous reply, i use "Group" function, but it would not change the data model,
please note, i add two "operations",
one is "count"(count rows) based on "program" column,
another is "all"(don't summarized), it means it would be the original columns.
then i get two columns, one is "count", another is "all",
in "all" column, there are all my original columns nested here,
i click on "expand" icon from the "all" column and select columns i need, i can get all original columns.
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- nilimarodrigues6 years agoHelper III
This is an awesome idea! I learnt something new today. Thank you!