Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I have done this using M, but I need it with DAX.
Here is an example of what I have and want to do
I need to identify if Comment contains any of the keywords, in case it does, it should pull the group.
In a longer version:
I need a DAX column or measure to be added to a table visual where the first column is the entire Comment column, and the second is the column I need to calculate. The measure/column should return the value in Gruop in case the word in Keyword is found in the text contained in the Comment.
Solved! Go to Solution.
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RiUw8jVEYBndpdIKg?e=rJrlXc
Hi,
Write these calculated column formulas
keyword = FIRSTNONBLANK(FILTER(VALUES('Comment Group'[keyword]),SEARCH('Comment Group'[Keyword],Comments[Comment],1,0)),1)
Group = LOOKUPVALUE('Comment Group'[Group],'Comment Group'[Keyword],Comments[keyword])
Hope this helps.
Hi,
Write these calculated column formulas
keyword = FIRSTNONBLANK(FILTER(VALUES('Comment Group'[keyword]),SEARCH('Comment Group'[Keyword],Comments[Comment],1,0)),1)
Group = LOOKUPVALUE('Comment Group'[Group],'Comment Group'[Keyword],Comments[keyword])
Hope this helps.
Thank you @Ashish_Mathur
This worked as expected and its pretty easy to understand the DAX code, it was just a bit slow to calculate the keyword column, but it did what I wanted.
You are welcome.
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RiUw8jVEYBndpdIKg?e=rJrlXc
Thank you @Ahmedx
Your solution worked as expected, in contrast with what @Ashish_Mathur proposed, your code seems much faster, but a bit harder to read and understand.
User | Count |
---|---|
77 | |
74 | |
60 | |
60 | |
46 |
User | Count |
---|---|
109 | |
95 | |
86 | |
79 | |
61 |