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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Ewo
Frequent Visitor

How To Get Counts Of Summarized Data

Hi,

 

I m trying to get Max([Weekly Service Sequence]) each TeamId and group them by values like (1,2,3, 4N'more).
i shared an example data and result sample to explain better.

Excel Link : Download Data

 

GroupedDataImg.JPG

 

 

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Ewo Please try below steps

 

For your 1st Question - Create a New Table as below

 

Test261Out1 = SUMMARIZE(Test261Grouping,Test261Grouping[TeamId],"MaxWeeklyServiceSequence",MAX(Test261Grouping[WeeklyService]))

Then add a New Column to the above table as

 

SortKey = SWITCH([MaxWeeklyServiceSequence],1,1,2,2,3,3,4)

For 2nd Question - Create a New Table as below which will take the above created table as input.

 

Test261Out2 = SUMMARIZE(Test261Out1,Test261Out1[GroupName],Test261Out1[SortKey],"TeamCount",COUNTROWS(Test261Out1))

Then select GroupName field and change the "Sort By Column" under Modelling tab to SortKey field

 

image.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

2 REPLIES 2
PattemManohar
Community Champion
Community Champion

@Ewo Please try below steps

 

For your 1st Question - Create a New Table as below

 

Test261Out1 = SUMMARIZE(Test261Grouping,Test261Grouping[TeamId],"MaxWeeklyServiceSequence",MAX(Test261Grouping[WeeklyService]))

Then add a New Column to the above table as

 

SortKey = SWITCH([MaxWeeklyServiceSequence],1,1,2,2,3,3,4)

For 2nd Question - Create a New Table as below which will take the above created table as input.

 

Test261Out2 = SUMMARIZE(Test261Out1,Test261Out1[GroupName],Test261Out1[SortKey],"TeamCount",COUNTROWS(Test261Out1))

Then select GroupName field and change the "Sort By Column" under Modelling tab to SortKey field

 

image.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Thanks alot @PattemManohar ,

First Summarization and Switch function solved the problem 🙂 
I made some changes on it and worked. 

Thank you again for showing path.

 

Best,

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.