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
vin123
Frequent Visitor

average values then sum based on a unique ID

Hi all. I am trying to get a sum of citations in a faculty but for de-duplicated paperIDs. Here is my dummy data:

 

fac.JPG

As you can see, one faculty can have multiple authors to a paper ID. But I don't want to double count citations if it's for the same paper ID, therefore I want to either exclude the Author column or somehow fix the paper ID column as unique.

 

I'm coming from Tableau so please bare with me as this is the way I'd do it in Tableau:

 {FIXED [Paper ID]: AVG([Citations])}   -- and then SUM this Measure when dragged to the graph.

 

Here is how I'd like the data to look:

 

FacultyCountofPaperIDSum of Citations
Arts420
Science411

 

But what I'm getting is the Arts faculty with 30 citations, because it's counting PaperID1001 twice. 

I'm struggling to find the dax calculation to average the citations by the paper ID, then take the SUM. Or fix the paper ID somehow? Thank you

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try Like

Sum of Citations= sumx(summarize(table, table[Faculty], table[PaperID],"_Citations" ,max(Citations)),[_Citations])
CountofPaperID = distinctcount(table[PaperID])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Try Like

Sum of Citations= sumx(summarize(table, table[Faculty], table[PaperID],"_Citations" ,max(Citations)),[_Citations])
CountofPaperID = distinctcount(table[PaperID])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

this works great, thankyou! 

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.