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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Main category and sub categoy in the same column

Hello!
I have a table that looks like this:

Main Cat1aaabbb
Main Cat2ccc

ddd

Sub Cat2.1eeefff
Sub Cat 2.2ggghhh
Main Cat3iiijjj

And i would like to split them up to make independant calculations with sub categories and main categories. 
Do you know how to do that?

Thanks!

1 ACCEPTED SOLUTION
ribisht17
Community Champion
Community Champion

@Anonymous ,

 

What is the differentiating factor, how can you detect when this is a category/sub-category?

For example, if you have a column say Flag, then you can create a different column based on Flag='Yes' 

You will have a new column like

 

Check_Cate_Sub-Cate

Category

Sub-Category

Category

 

so forth and so on......as you said independent

 

Now make use of Pivot to see those as headers(Category/Sub-category)

 

Regards,

Ritesh

View solution in original post

2 REPLIES 2
SpartaBI
Community Champion
Community Champion

@Anonymous first of all you don't have to split them in order for calculations will do whatever you want them to do 🙂
Anyway, you can create 2 calculated tables:

 

 

 

CategoryTable = 
	FILTER(
		'Table',
		SEARCH("Main",'Table'[A],1,BLANK()) > 0
	)
	
	
SubCategoryTable = 
	FILTER(
		'Table',
		SEARCH("Sub",'Table'[A],1,BLANK()) > 0
	)

 

 

 

If this solved your question please mark this as a solution. Appreciate Your Kudos 🙂

ribisht17
Community Champion
Community Champion

@Anonymous ,

 

What is the differentiating factor, how can you detect when this is a category/sub-category?

For example, if you have a column say Flag, then you can create a different column based on Flag='Yes' 

You will have a new column like

 

Check_Cate_Sub-Cate

Category

Sub-Category

Category

 

so forth and so on......as you said independent

 

Now make use of Pivot to see those as headers(Category/Sub-category)

 

Regards,

Ritesh

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.