cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Count IF between 2 tables

Hey,

 

I've tried to create a new table (table1) for counting links, if they are in the other table ( the libary-table).

If the links are in the libary, I want to know how often they are in table1.

See the picture from excel: 

Screen1

Please mind, that the libary has only the "main-parts" of the links. So I guess we have to work with asterisks.

 

Many thanks in advance,

Nick

4 REPLIES 4
Highlighted
New Member

Count if on different tables

Hey,

 

I want to count the target - URL's, if they exist in the Libary-table. Please see the image below:

 

I thought I can handle this with a new table and the summarize-function, but I'm stuck. I don't really care, if I have to add a new column or a new table or just a measure. The main part is, that this function has to work 🙂

 

Many thanks in advance,

Dave

Highlighted
Community Support
Community Support

Re: Count IF between 2 tables

Hi @DaveRaul,

 

You can create a calculated columns in the table like below:

 

Column = var t=LEFT('Table1'[Target - URL],SEARCH("/",'Table1'[Target - URL])-1)
return
RIGHT(t,LEN(t)-SEARCH(".",t))

 

Count = IF( RELATED( 'Library'[Library -  URL] ) <> BLANK(), CALCULATE( COUNTROWS( Table1 ), ALLEXCEPT( Table1, Table1[Column] ) ) ) 

 

 

q5.PNG

 

Best Regards,
Qiuyun Yu

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

Re: Count IF between 2 tables

Thank you very much for the answer.

 

I tried your code but it does not work properly 😕

I got the following problem:

If the string is extactly the same or of it is seperated by '/', it does work, .

But the code has to recognize the Url, if the Url just contains the library-Url-String. 

In Excel one can write an asterisk like: if("cde"="*d*","Yes","No")

in this case i want the response "Yes", but your code deliveres for this case "No".

 

I realised this wasn't exactly formulated. Sorry for that.

Highlighted
Community Support
Community Support

Re: Count IF between 2 tables

Hi @DaveRaul,

 

In DAX, it doesn't have function perform as wildcards. The DAX provided in my previous reply is based on your sample data, as you mentioned it will not work, can you please share the sample to clarify which scenario doesn't work?

 

Best Regards,
Qiuyun Yu

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

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors