Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have two tables
I want to compare Series with Runs and return an output of the number of occurances of each of the strings in Runs table as a new column COUNTS. Basically in this example, the output would be as shown on the right side of that pic. I can compare single values using CONTAINSSTRING. However, I'm not sure how to compare two columns. Can someone help me?
Thanks in advance...!
Solved! Go to Solution.
Hi @amani1980 ,
You can achieve your goal by writing a measure like the one below:
CountsMeasure =
VAR CurrentSeries = SELECTEDVALUE(Series[Series])
RETURN
SUMX(
Runs,
IF(CONTAINSSTRING(Runs[Runs], CurrentSeries), 1, 0)
)
You can either use this measure in a calculated column, as shown below, or place it next to the Series rows in the matrix visual, as demonstrated in the one below.
I have attached an example pbix file for your reference.
Hi @amani1980 ,
You can achieve your goal by writing a measure like the one below:
CountsMeasure =
VAR CurrentSeries = SELECTEDVALUE(Series[Series])
RETURN
SUMX(
Runs,
IF(CONTAINSSTRING(Runs[Runs], CurrentSeries), 1, 0)
)
You can either use this measure in a calculated column, as shown below, or place it next to the Series rows in the matrix visual, as demonstrated in the one below.
I have attached an example pbix file for your reference.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |