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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Categorize based on other products

Hello everyone, I couldn't find a similiar topic for my problem.

 

I have sales data from store A which has sales from our products and from our competitors. Store A has their products categorized in a certain way which is not compatible with our categorization. Luckily, I have the categorization for our products so I can recategorize them but can't do that to the competitor products without a lot of grinding and manual work.

 

So here is my problem. I want to tell DAX to see if the "New Category" column is blank. If it is, search for "product" that has "New Category" and is the same value for the current row in "Old Category" (example, both are categorized as 1 in old category). Then, put value of new New Category (if previously they were both 1 now both of them should be 1A).


I want:

Old CategoryProductNew category
1Competitor A 
1Our product A1A
2Competitor B 
2Our product B2A


 to look like 

 

Old CategoryProductNew categoryCalc column
1Competitor A 1A
1Our product A1A1A
2Competitor B 2A
2Our product B2A2A


Thanks!

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

Calc Column = CALCULATE(MAX(Table1[New category]);ALLEXCEPT(Table1;Table1[Old Category])) 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

SU18_powerbi_badge

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

Calc Column = CALCULATE(MAX(Table1[New category]);ALLEXCEPT(Table1;Table1[Old Category])) 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

SU18_powerbi_badge

Anonymous
Not applicable

That makes sense. I haven't thought about it that way. Thanks for the blazing fast answer!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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