cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CunningMan Frequent Visitor
Frequent Visitor

How to SUM a value once (instead of per column)

I have a table that is created by a UNION of several other tables.

 

The UNION of several tables effectively counts recordIDs. Here's the code creating that table:

PBI Question pt01.JPGUNION and SELECT COLUMNS generating the table in question

 

One of the fields in the 'Campaign Sourced & Influenced' table is 'Amount'. I'd like to SUM amount for only one of the columns, the related 'Campaign Sourced and Influenced OTY'.

PBI Question.JPGOriginal table created by Union and Select Columns

 

Using the field 'Amount' and summing it as a value almost works except the SUM appears with every Column generated by the UNION table. 

 

PBI Question pt 2.JPGThe SUM appears with every column. I don't want that

 

How can I SUM the 'Amount' for only one column, Campaign Sourced and Influenced OTY' and put it next to that column?

2 REPLIES 2
Super User II
Super User II

Re: How to SUM a value once (instead of per column)

Have you considered doing the Sum before you do the union. 

You would have to create a dummy field in the tables in the union that do not show the sum.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




CunningMan Frequent Visitor
Frequent Visitor

Re: How to SUM a value once (instead of per column)

Solved it another way. 

 

Take a step back and question if the UNION method makes sense? (it doesn't - theres a much easier way)

 

Since the table is related in the model, simply create quick measures and drop them into the values.

 

PBI finished fields.JPGa bunch of quick measures created in the UNION table

 

Here's the output.

 

PBI finished table.JPGCounts and SUMs as they should be

 

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors