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.
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
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% |
Hi @Anonymous ,
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.
@Anonymous
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
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |