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.
I am trying to use a measure to score specific data based on how many keywords appear in the description, the keywords considered should be limited by a slicer. For example, if in the slicer the word brown and large are selected, an item with both words in the description will be scored 2, one with only one of the words will be scored 1 and the rest will be scored 0. This data is then used to create a bar chart.
I am using the following function:
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _table=ADDCOLUMNS(ALLSELECTED(KeyWords[KeywordsC]),"1",MAX('Facts-Beer'[Description]))
var _table1=ADDCOLUMNS(_table,"Flag",IF(CONTAINSSTRING([1],[KeywordsC]),1,0))
return
SUMX(_table1,[Flag])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Here is the link of the function, I hope it helps you:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _table=ADDCOLUMNS(ALLSELECTED(KeyWords[KeywordsC]),"1",MAX('Facts-Beer'[Description]))
var _table1=ADDCOLUMNS(_table,"Flag",IF(CONTAINSSTRING([1],[KeywordsC]),1,0))
return
SUMX(_table1,[Flag])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hello Liu Yang,
If you have the time and are willing, could you help explain what the function does. Would increase my odds of coming up with a solution myself in the future.
Kind regards,
Romar
You will likely need to supply some sample data and share a sample PIBX.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering 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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |