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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
SarahAlsterspre
Helper II
Helper II

calculations within non-related tables

hey,

 

I have to tables from two different sources and one column contains a text which contains an ID that is defined in another table. 

(I cannot publish a Message with tables - i am getting errors)

 

Source 1:

Company Name          Sponsor (SP-ID)            NL-ID

kuwerhgidufg              SP0001                        NL-0001

keurghk                       SP0002                        NL-0008

...                                   ....                                .....

 

Source 2 (Newsletter):

Title                       Openers                 URL

ifuwarhefkl             267                     htt...text...NL-0001... .

luadrhoi                  23829                 htt.....NL-0008...

iufhsdfkön             12882                  htt... NL-0001

...                             ...                           ...

 

-> I would like to have a third table or measurement that results in:

Sponsors             Total Openers

SP0001                13.149

SP0002                 .....

 

 

The problem is that these to tables so far cannot be related in any way.

 

In excel I would build something like "if Column [URL] contains [NL-ID] then sum up column [Openers]"

 

I am looking forward to solutions! 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SarahAlsterspre , You can have column like this in a table 1

sumx(filter(Newsletter, search( Source1[NL-ID], Newsletter[URL],,0)>0),Source1[Openers])

 

refer: https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@SarahAlsterspre , You can have column like this in a table 1

sumx(filter(Newsletter, search( Source1[NL-ID], Newsletter[URL],,0)>0),Source1[Openers])

 

refer: https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
westwrightj
Resolver III
Resolver III

Hey @SarahAlsterspre ,

 

    Okay, so I think I see what you are going for here and there are a few different ways you can go about it. The solution I've provided is not the most eqloquent or complex but should meet the outcome you listed.

 

I've used the following sample data for this solution

 

westwrightj_0-1605533861171.png

 

westwrightj_1-1605533872640.png

 

So we can actually make a measure like the following to get the outcome table you were looking for without connecting anything. In this case this measure would only work properly in a table format and in this example is calculating the average opener number

 

TheMeasurement = 

var TheNL_ID = MAX('Source 1'[NL-ID])

return

CALCULATE(AVERAGE('Source 2'[Openers]), CONTAINSSTRING('Source 2'[URL], TheNL_ID))

 

 

 

westwrightj_2-1605534366542.png

 

Let me know if that solution works or if we want to go back and tinker with it some more

 

 

 

camargos88
Community Champion
Community Champion

@SarahAlsterspre ,

 

You can use this measure:

 

_Openers = 
VAR _ndID = SELECTEDVALUE('Table'[NL-ID])
RETURN CALCULATE(SUM('Table (2)'[Openers]), CONTAINSSTRING('Table (2)'[URL], _ndID))

 

Capture.PNG

 

If you have a patterns, you can split the url column and related both tables, avoid any problem.

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.