The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |