Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
EllenBakker
New Member

Countif

Hi,

 

I try to Countif how many times the numbers of value's  in one colum exist, if the same value exits in an other colum..

Any one who can help?

 

Thanks Ellen

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @EllenBakker ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create a measure as below to get the number of repetitions of name1

Countif = CALCULATE(COUNT('Table'[name1]),ALLEXCEPT('Table','Table'[name1]))

2. Create a measure as below to judge if the same value for name1 exist in name2

name1 exist in name2? = 
VAR _tab =
    VALUES ( 'Table'[name2] )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[name1] ) IN _tab, 1, 0 )

yingyinr_0-1638236936066.png

If the above one can't help you get your expected result, please provide some sample data with Text format and your expected result with calculation logic and special example explanation. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @EllenBakker ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create a measure as below to get the number of repetitions of name1

Countif = CALCULATE(COUNT('Table'[name1]),ALLEXCEPT('Table','Table'[name1]))

2. Create a measure as below to judge if the same value for name1 exist in name2

name1 exist in name2? = 
VAR _tab =
    VALUES ( 'Table'[name2] )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[name1] ) IN _tab, 1, 0 )

yingyinr_0-1638236936066.png

If the above one can't help you get your expected result, please provide some sample data with Text format and your expected result with calculation logic and special example explanation. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahoneypat
Microsoft Employee
Microsoft Employee

Please provide some mock data along with expected result, so someone can suggest a specific solution.

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.