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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Lookup a category across columns and find sum

I have a dataset which looks like this. Each contract has multiple tags

Contract TitleAward ValueTag ATAG BTAG C
  AAAADDDDCCCC
  BBBB DDDD
  CCCC AAAA

I want to create a table which displays the total award value across each tag. 

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

I recommend unpivoting your tag columns and using a simple SUM measure. This should get yo uthe result you want.





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

Proud to be a Super User!




View solution in original post

10 REPLIES 10
ValtteriN
Super User
Super User

Hi,

I recommend unpivoting your tag columns and using a simple SUM measure. This should get yo uthe result you want.





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

Proud to be a Super User!




Anonymous
Not applicable

All tags were in a single cell, so I separted them in different columns. Can you help with the dax code if possible?

Just as a clarification: do you want to show it like TAG A: value or like AAAA: value?





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

Proud to be a Super User!




Anonymous
Not applicable

AAAA value, so that I can identify the tags with the overall highest award value.

Okay, Then there are limitations in DAX solution, since you would have to refer to each column separately. How many "Tag"-columns d oyou have?





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

Proud to be a Super User!




Anonymous
Not applicable

I have 47 such columns

Yeah, In that case the best solution would be to unpivot these columns like this:
So in PQ select the column and unpivot them. 

ValtteriN_0-1643381126944.png

 







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

Proud to be a Super User!




Anonymous
Not applicable

This was helpful! While double counting is unavoidable if I want to display the award value for tags, it is not preferable for contract title as that would be a misrepresentation. Is there a way to work around that?

@Anonymous  I am not sure I follow. If you want to count distinct values you can include filters or use functions like DISTINCT in your measures. Now that you have unpivoted data what is your desired end result?





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

Proud to be a Super User!




Anonymous
Not applicable

I plan to make two tables:

1. Contract Title and award value

2. Tags and award value

I want these two to interact with each other. But I want the Contract Title to not display duplicate values as we have unpivoted the columns.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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