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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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:

UNION and SELECT COLUMNS generating the table in questionUNION 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'.

Original table created by Union and Select ColumnsOriginal 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. 

 

The SUM appears with every column. I don't want thatThe 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
Anonymous
Not applicable

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.

 

a bunch of quick measures created in the UNION tablea bunch of quick measures created in the UNION table

 

Here's the output.

 

Counts and SUMs as they should beCounts and SUMs as they should be

 

kentyler
Solution Sage
Solution Sage

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!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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