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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Create measure to sum a column with multiple values from another dataset

Hi,

 

I have 3 tables. 

 

image.png

 

 

 

 

 

 

 

 

 

Channel subscribers are individual subscribers. I want to create a measure which calculates total subscribers for each channel. Total subscribers = Channel subscribers + Pack subscribers. Pack subscribers will be the subscribers in the pack where the channel is present. 

e.g. Total subscribers for BBC = 100 (Individual channel subscribers) + [ 500 (Silver) + 200 (Platinum) ] = 800

similarly for CNN = 200 + (200 + 300 + 500) = 1200 as it is available in all the packs, so subscribers of all the packs will be added. 

 

There are many such channels and even more packs. Can someone please help me in creating a measure.

Also, the two subscriber tables (channel and packs) are not directly related to mapping table. There is a pack master and channel master table which are linked by pack name and channel name respectively to these subscriber tables. 

However, mapping table is linked to both master tables by channel and pack name.

 

@v-lili6-msft 

 

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

Hi @Anonymous ,

 

First create a column in table mapping:

 

Column = LOOKUPVALUE('Pack subscriber'[Pack subscriber],'Pack subscriber'[Packs],'Mapping'[Pack],blank())

 

Then create a measure as below:

 

Measure = 
var _total=SUMX(FILTER('Mapping','Mapping'[Channel]=MAX('Mapping'[Channel])),'Mapping'[Column])
Return
SUM('Channel subscribers'[Channel subscribers])+_total

 

Finally you will see:

Annotation 2020-05-07 140519.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

First create a column in table mapping:

 

Column = LOOKUPVALUE('Pack subscriber'[Pack subscriber],'Pack subscriber'[Packs],'Mapping'[Pack],blank())

 

Then create a measure as below:

 

Measure = 
var _total=SUMX(FILTER('Mapping','Mapping'[Channel]=MAX('Mapping'[Channel])),'Mapping'[Column])
Return
SUM('Channel subscribers'[Channel subscribers])+_total

 

Finally you will see:

Annotation 2020-05-07 140519.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Try this.

Measure = 
SUM( 'Channel subscribers'[Channel subscribers] )
+ SUMX( Mapping, RELATED( 'Pack subscribers'[Pack subscribers] ) )

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Anonymous
Not applicable

Hi Mariusz, I am not getting the pack subscribers table in the related function in sumx. I think this is because tables are not directly related. They are related through master tables indirectly. Getting stuck here.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors