Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Grouping Categories

Hi everyone,

 

I am designing a pie chart that the categorical field has a lot of values which makes the chart to be clustered. I am thinking creating a new column that will group any category that has more than 100 as "Others" in the chart.

 

 

4 Replies

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may create a conditional column in 'Query Editor' or a calculated column in Power BI Desktop.

    Conditional column:

     

    Calculated column:

    Calculated Column Group = 
    IF(
        [Value]>=100,
        "Others",
        [Category]
    )

     

    Result:

     

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I was able to use this to solve it but I ntoiced it does not work well with other filters in the report

      Car Group = 
      IF (
      	CONTAINS ( 
      		TOPN (
      			10,
      			SUMMARIZE ( 
      				'Sales',
      				[Name],
      				"Total Sales",
      				SUM ( 
      				'Sales'[Amount]
      				)
      			),
      			[Total Sales]
      		),
      		'Sales'[Name],
      		'Sales'[Name]
      	) = TRUE (),
      	[Name],
      	"Other Cars"
      )
  • Anonymous 

    Can you share your .pbix file? Upload it to OneDrive or DropBox and share the link here.  You will need an additional table with the player names and an additonal row of "Other Players" then the measure is pretty straight forward.

  • FrankAT's avatar
    FrankAT
    Community Champion

    Hi Anonymous 

    use the new tool data groups. Select the column in data view, click on button Data groups > New data groups and play around the settings in the dialog.

    Dailog: Groups

     Regards FrankAT