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.
Good day Guys!
I just want to ask how I can compare 2 columns to find the matching data in same table
Here's my example:
As you can see I have 2 columns if the data on COLUMN1 has matched on COLUMN2 then it counts.
Thanks in advance!
~Ran
Solved! Go to Solution.
You can try
Num matches =
COUNTROWS (
INTERSECT ( VALUES ( 'Table'[Column1] ), VALUES ( 'Table'[Column2] ) )
)
Hi @RanHo,
I test with a sample formula that is similar to 'johnt75' provided and it work well, did any whitespace or special character in your fact table records?
Can you please some dummy data that keep the raw data structure and paste it here in table format? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@v-shex-msft Yes I already accepted it as a solution. My bad self error, but it's solved now thanks.
You can try
Num matches =
COUNTROWS (
INTERSECT ( VALUES ( 'Table'[Column1] ), VALUES ( 'Table'[Column2] ) )
)
@johnt75 I already try it but unfortunately it's not working the output was blank. But thanks for reply.
~Ran
Hi @RanHo ,
This is not the best solution but should produce the output you are looking for. Assuming you have 1 table below:
Step 1: Create a calculated table using " Column 2"
Table = SUMMARIZE(Sheet1,Sheet1[Column2])
Step 2: Build a relationship between the two tables
Step 3: Create a new measure
Measure =
CALCULATE(
COUNT(Sheet1[Column1]),
FILTER(Sheet1,Sheet1[Column1] = RELATED('Table'[Column2])
)
)
Step 4: Visualize
BR
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |