cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
palmeirense_
Frequent Visitor

Measure to return category values for each brand

Hi,

 

I am just getting started with DAX so apologize for what I think is a simple question. I have not been able to find a question quite like mine in the forum but it's possible I couldn't find the right way to search it so please bear with me.

I have a table that shows growth rates by brand where each brand might belong to a different category. I have the first 3 columns of this table working correctly. I need to fetch a value for the 4th column that identifies which category we're dealing with and pull the growth rate for that category.

In Excel I would have done this using a lookup, how do create that kind of logic in DAX? Find category (e.g. candy, then return growth rate for candy)

In my current connection to this database I can only create measures, not columns or tables (it's been disabled by our IT team).

Thanks so much and apologize for what I know is an unclear question. I can fill in the gaps if you tell me what else I can provide

 

CategoryBrandGrowth Rate BrandGrowth Rate for Category
ChocolateBrand A6%5%
CandyBrand B12%2%
CandyBrand C-3%2%
ChocolateBrand D14%5%
3 REPLIES 3
Icey
Community Support
Community Support

Hi @palmeirense_ ,

 


Category Brand Growth Rate Brand Growth Rate for Category
Chocolate Brand A 6% 5%
Candy Brand B 12% 2%
Candy Brand C -3% 2%
Chocolate Brand D 14% 5%


Is the "Growth Rate for Category" column the result you want? 

If it is, how did you get it? 

If not, what's the result you want? Could you share us more details?

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

 

VijayP
Super User I
Super User I

@palmeirense_ 

you can use SELECTEDVALUE Funciton

SWITCH(TRUE(),

SELECTEDVALUE([Category])="Canday", growth of candy,growth of cholocate).

Try this and let me know if you are able to achieve or not

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hi, thank you for the reply. I couldn't get your expression to work unfortunately

Just a bit more info: I have a list of close to 20 categories and the sales % chg should be iterating at every row depending on the category field that each brand belongs to. 
The sales % chg is a measure that already exists in my database so I'm wondering do I need to define any category names within my expression? Shouldn't the formula recognize that it's dealing with the category in question for that particular row?

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors