Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello teachers, I am a Korean student.
I want to count the duplicate values of string data and express the TOP 5 and the remaining values.
I am able to count the total string values, but not able to count the duplicates of each value.
Below is a simple example.
Order | Duplicate Count | Produt | Rank | Total Count | |
A | 3 | A | 1 | 3 | |
B | 2 | B | 2 | 2 | |
B | 2 | C | 3 | 2 | |
A | 3 | Others | 2 | ||
A | 3 | ||||
C | 2 | ||||
D | 1 | ||||
F | 1 | ||||
C | 2 |
I plan to use these values for matrix objects and map objects.
Please help me. Sir and Maam
Solved! Go to Solution.
Hi @Anonymous
You can refer to the following example.
1.Create a calculated table
Table 2 = var a=SUMMARIZE('Table',[Order])
var b={"Others"}
return UNION(a,b)
2.Then create a measure
Measure = var a=SUMMARIZE('Table',[Order],"Countrows",COUNTROWS('Table'))
var b=TOPN(3,a,[Countrows],DESC)
var c=SUMMARIZE(b,'Table'[Order])
return SWITCH(TRUE(),SELECTEDVALUE('Table 2'[Order])="Others",SUMX(a,[Countrows])-SUMX(b,[Countrows]),SELECTEDVALUE('Table 2'[Order]) in c,SUMX(FILTER(a,[Order] in VALUES('Table 2'[Order])),[Countrows]))
Put the column of table 2 and the measure to a table visual
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can refer to the following example.
1.Create a calculated table
Table 2 = var a=SUMMARIZE('Table',[Order])
var b={"Others"}
return UNION(a,b)
2.Then create a measure
Measure = var a=SUMMARIZE('Table',[Order],"Countrows",COUNTROWS('Table'))
var b=TOPN(3,a,[Countrows],DESC)
var c=SUMMARIZE(b,'Table'[Order])
return SWITCH(TRUE(),SELECTEDVALUE('Table 2'[Order])="Others",SUMX(a,[Countrows])-SUMX(b,[Countrows]),SELECTEDVALUE('Table 2'[Order]) in c,SUMX(FILTER(a,[Order] in VALUES('Table 2'[Order])),[Countrows]))
Put the column of table 2 and the measure to a table visual
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
68 | |
53 | |
39 | |
33 |
User | Count |
---|---|
71 | |
63 | |
57 | |
49 | |
46 |