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.
how can i get a sum of all values of three columns (minor, major, critical) but only distinct values based on the ID column. My data has repeating rows and I can't remove because I'm using other fields value. (ex. since ID 14 is repeating, we would only count that once)
ID | Minor Total | Major Total | Critical Total |
12 | 2 | 1 | 0 |
10 | 0 | 2 | 1 |
11 | 1 | 11 | 0 |
13 | 3 | 3 | 3 |
14 | 4 | 0 | 1 |
14 | 4 | 0 | 1 |
15 | 5 | 0 | 0 |
14 | 4 | 0 | 1 |
14 | 4 | 0 | 1 |
Solved! Go to Solution.
@jcastr02 , Create measure like this for all three columns
sumx(summarize(Table,Table[ID], Table[Minor Total]),[Minor Total])
sumx(summarize(Table,Table[ID], Table[Major Total]),[Major Total])
sumx(summarize(Table,Table[ID], Table[Critical Total]),[Critical Total])
Try Amit's codes and add up all of them into a measure like below, this should work.
Measure = sumx(summarize('Table','Table'[ID], 'Table'[Minor Total]),[Minor Total]) + sumx(summarize('Table','Table'[ID], 'Table'[Major Total]),[Major Total]) + sumx(summarize('Table','Table'[ID], 'Table'[Critical Total]),[Critical Total])
You can also try this measure:
Measure 2 = SUMX(SUMMARIZE('Table','Table'[ID],'Table'[Minor Total],'Table'[Major Total],'Table'[Critical Total]),'Table'[Minor Total]+'Table'[Major Total]+'Table'[Critical Total])
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
In adition to @amitchandak 's dax, you can also try below measure:
@jcastr02 , Create measure like this for all three columns
sumx(summarize(Table,Table[ID], Table[Minor Total]),[Minor Total])
sumx(summarize(Table,Table[ID], Table[Major Total]),[Major Total])
sumx(summarize(Table,Table[ID], Table[Critical Total]),[Critical Total])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |