Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Community,
I am facing a challenge while trying to extract specific text from multiple category fields using DAX calculations
Here's the situation:
I have a table with the following structure:
My goal is to extract the text "Late" or "Early" from any of the categories (Category1, Category2, Category3, or Category4). I can successfully do this with individual column using a direct formula such as:
DAX
= IF(CONTAINSSTRING([Category1], "Late"), "Late", "Early")
However, I want to make this dynamic by using a parameter so that I can choose any category to extract the text from. For this purpose, I created a parameter (named `Parameter Selection`) for Category1, Category2, Category3, and Category4. My intention is to use the following formula to determine the text based on the selected category:
DAX
= IF(CONTAINSSTRING(['Parameter Selection`], "Late"), "Late", "Early")
Unfortunately, when I use this formula with the parameter, I encounter the following error:
Questions:
1. How can I resolve the error related to field relationships?
2. Is there a specific way to set up parameters in DAX calculations to avoid such issues?
3. What is the best approach to dynamically extract text like "Late" or "Early" from selected categories using parameters?
Any guidance or suggestions to solve this problem would be greatly appreciated.
Thank you for your help!
Hi
My requirement differs slightly: depending on the selected category, the output should display "Late" or "Early" for each value within that chosen category.
Ex
Hi first prepare measures for each category like the following
Create one parameter table
use the same parameter as slicer and part of the output table
If the above meets your requirement then pls accept the same as your solution.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
15 | |
13 | |
11 | |
9 | |
8 |