Hi guys, I am currently building an analytical feature within my app where I have a pie chart displaying the percentages of each item within the column as seen below.
However, I want to filter the pie chart above by only showing a specific item percentage and labelling the rest as "others", is there a way to do so or how can I edit my code below? Thanks in advance!
@WarrenBelz @RandyHayes @Drrickryp
Solved! Go to Solution.
Hi @Kane2 ,
Please try:
AddColumns(
AddColumns(
GroupBy(
AddColumns(HiddenMasterGallery.AllItems,"NewLabel",If(HiddenCategory="specific item","specific item","Others")),
"NewLabel",
"_cat"
),
"_total",CountRows(HiddenMasterGallery.AllItems),
"_number",CountRows(_cat)
),
"_percentage",
Text((_number/_total)*100,"0%")
)
Best Regards,
Bof
Hi @Kane2 ,
Please try:
AddColumns(
AddColumns(
GroupBy(
xxxx
),
),
"_percentage",
If(HiddenCategory="specific item",Text((_number/_total)*100,"0%"),"others")
)
Best Regards,
Bof
Hi I did as you said, it worked at seen below. However, is there a way to merge all of the "others" section of the pie chart into 1 section? Thanks Again 🙂
Hi @Kane2 ,
Please try:
AddColumns(
AddColumns(
GroupBy(
AddColumns(HiddenMasterGallery.AllItems,"NewLabel",If(HiddenCategory="specific item","specific item","Others")),
"NewLabel",
"_cat"
),
"_total",CountRows(HiddenMasterGallery.AllItems),
"_number",CountRows(_cat)
),
"_percentage",
If(NewLabel="specific item",Text((_number/_total)*100,"0%"),"others")
)
Best Regards,
Bof
Hello again, the image below shows my current chart. Is it possible to change both the labels to percentages while having the legend as "Specific Item" & "Others"?
Hi @Kane2 ,
Please try:
AddColumns(
AddColumns(
GroupBy(
AddColumns(HiddenMasterGallery.AllItems,"NewLabel",If(HiddenCategory="specific item","specific item","Others")),
"NewLabel",
"_cat"
),
"_total",CountRows(HiddenMasterGallery.AllItems),
"_number",CountRows(_cat)
),
"_percentage",
Text((_number/_total)*100,"0%")
)
Best Regards,
Bof
Thank you so much! it works perfectly now:)))
User | Count |
---|---|
257 | |
110 | |
97 | |
52 | |
39 |