Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
adumith
Helper I
Helper I

Identifying user tickets

Hello everyone, 

 

I have a table called "zendesk" which contains user tickets. Each one has a category assigned to it. I need to identify the requesters with the most tickets per category.

 

I have tried several formulas, but they all give me the same error, and I don't know how to solve it.

 

Formula:

 

TopRequestersPerCategory = 
VAR RequestersPerCategory =
    SUMMARIZE(
        zendesk,
        zendesk[Requester ],
        zendesk[Category],
        "TotalRequirements", COUNTROWS(zendesk)
    )
RETURN
    ADDCOLUMNS(
        SUMMARIZE(
            RequestersPerCategory,
            RequestersPerCategory[Requester],
            "MaxRequirements", MAX(RequestersPerCategory[TotalRequirements])
        ),
        "Category", SELECTEDVALUE(RequestersPerCategory[Category])
    )

 

Error:

 

adumith_1-1688057562104.png

 

Any ideas?

 

Thank you,

1 ACCEPTED SOLUTION

Thank you for your reply.

 

However, it's returning this error:

adumith_0-1688422994480.png

 

 

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

There you go.

 

Ticket_IDRequesterCategory
1Osbourne RiddleVentosanzap
2Leda LoweyRank
3Bevvy DrinkallOverhold
4Ignace DittsDuobam
5Benedikta HalfacreDuobam
6Kathlin GauvainKonklux
7Lacie KamienskiZontrax
8Charline McGillegholeFlexidy
9Andres PaoloneY-Solowarm
10Filberte RobkerTampflex
11Emmalynne RankmoreIt
12Lauryn TavnerAlpha
13Dion BlazewskiSubin
14Waneta WeavillDuobam
15Rozanne MaffiaY-Solowarm
16Ciro BruckentalTemp
17Shannah JobernDomainer
18Elena RabsonStronghold
19Allx Blyth**bleep**ip
20Bernardine SymcockSonsing
21Mayne KeirOtcom
22Abel SaddlerBiodex
23Nicky MatijasevicKeylex
24Marietta SjostromBytecard
25Drake DeversVentosanzap
26Weider RuoffKeylex
27Silva RaincinSonair
28Malorie PinwillVeribet
29Sybyl CareyOpela
30Nappy SilbersakVagram
31Layne ShulemZamit
32Alie LambellZathin
33Graehme DowdingStronghold
34Wendeline LafflingAlpha
35Frants PaulaFlexidy
36Giffer GarbarZoolab
37Rowland FramptonAlpha
38Marty ReckeY-find
39Heda PebworthZathin
40Rhona BinyonLotlux
41Jamey DaniaudTampflex
42Perle MilmoFlexidy
43Justinn TsarDaltfresh
44Maisey RichenZaam-Dox
45Silvain MayesNamfix
46Jaquith MilellaLatlux
47Benedetto ArangyTres-Zap
48Kessiah SpurmanRank
49Olympia NiezenIt
50Paula TomankowskiRank
51Wilek HaymesVeribet
52Johnathon JanauschekLotstring
53Artair SeebertVeribet
54Josi EnriqueDaltfresh
55Nevins TernY-find
56Ami BlanpeinAerified
57Philip Pritchitt**bleep**ip
58Ilyse WantlingHatity
59Fey SalzbergerSonsing
60Fredek LydiattBigtax
61Jena DraynBigtax
62Chuck MillettGembucket
63Trumann WillougheyQuo Lux
64Tamma GodilingtonTrippledex
65Virginie HouseleeSub-Ex
66Alexandr TilfordBitwolf
67Harri GilksSpan
68Layney MinetY-Solowarm
69Cosmo TregensoeViva
70Adey AgronDaltfresh
71Lindsay LeedTempsoft
72Shaine DaniauTranscof
73Isabella QueyosPannier
74Charlot WheelwrightProdder
75Brana LameyOpela
76Ambros FrazierTin
77Jillie McKearnenCardify
78Dewie BorhamOverhold
79Clarisse RemmerBigtax
80Lilian LatekNamfix
81Ethelin HinchonOverhold
82Sloan BucklesBiodex
83Waylon DykaZontrax
84Genevieve CalamVoltsillam
85Adaline WiburnBytecard
86Trix UrlichKonklab
87Nickie RundallY-find
88Les BabinHatity
89Sybille StoutherTin
90Stewart McSperrinNamfix
91Fania HuntressMatsoft
92Uriel LiptrodRank
93Tedmund OubridgeBytecard
94Sargent TiffanyVoyatouch
95Audrye RunnettTrippledex
96Valene O'DuilleainZathin
97Hilde MatussevichZoolab
98Parrnell Hardy-PigginTreeflex
99Corinna MaskellWrapsafe
100Gilly ReekSolarbreeze
101Xenos HillockOverhold
102Iorgo BenoisKonklab
103Malanie ProbinMatsoft
104Charlena ScneiderGreenlam
105Brenden BalcersSpan
106Marcelle JayeBamity
107Raddy GonoudeTranscof
108Alasdair HitschkeStronghold
109Andras FaughnanVoyatouch
110Linzy AmbroisSolarbreeze
111Judi ChrippesAlpha
112Lianna AlecockKanlam
113Sal CasillasKanlam
114Rosaleen LummNamfix
115Drusy EastlakeKonklux
116Katrine ManketellTempsoft
117Charline MasseiTampflex
118Ernest McCaugheyJob
119Ivy DowsonVoyatouch
120Daphne NiessenTranscof
121Athene GuihenNamfix
122Quill NarisPannier
123Leena Jeaffreson**bleep**ip
124Ethyl FarmloeHoldlamis
125Jourdan TremayleZamit
126Morse HullotSubin
127Clotilda LittlemoreSolarbreeze
128Pauline WallbankVoltsillam
129Evin SpringtorpPannier
130Petra MuinoDaltfresh
131Haskell ArtrickHatity
132Dyana Haggerston**bleep**ip
133Ulla LigginsOpela
134Ines MacCallumIt
135Chelsea FeildenSonair
136Meara GorioliY-find
137Julian GoodhewKonklab
138Corinna TinwellZamit
139Iggy HiseStronghold
140Gilda HardakerIt
141Sybille BowsVagram
142Worden AberdalgyY-find
143Ardine GriceOtcom
144Daisy DunbletonGembucket
145Mychal AcresTin
146Kippar BerrymanFlexidy
147Dermot CasariliStringtough
148Hildagarde SandhillKonklux
149Dannye WinksSonair
150Merwin CowterdRegrant

 

Thank you so much,

 

 

Hi,

Based on the data that you have shared, show the expected result clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
LuizKoller
Resolver I
Resolver I

Hello!

 

VAR TABLE =
TOPN(
    1,
    SUMMARIZE(
        zendesk,
        zendesk[Requester],
        zendesk[Category],
        "TotalRequirements", COUNTROWS(zendesk)
        ),
    [TotalRequirements],
    DESC
)


RETURN
MAXX(TABLE, zendesk[Requester])



Only the SUMMARIZE dont give you the results, you need something to return the "TOPN"
Put this Measure in a table with "Category"

Thank you for your reply.

 

However, it's returning this error:

adumith_0-1688422994480.png

 

 

Hello!

 

Looks like its missing the name of the measure,

 

"VAR TABLE =" is a Dax Function

 

 

It cant recognize "RETURN" because cant recognize "VAR"

Hello @LuizKoller ,

 

What visualization do you reccomend for this?

 

I'm asking you because, I would like to bring the result into a table visualization, how ever when I try to do it I'm just getting one column with a single column which just show one requester.

 

adumith_0-1688581510932.png

 

I mean I need to shw the result as a table like this:

adumith_1-1688581586042.png

Thank you in advance, 

 

 

 

 

Let me get this straight, you want a table with one category per line, the name of the user who opened the most tickets in that category, and the number of tickets, correct?

 

1. I would make a table putting the category in the rows and the measurement mentioned above, like this:

LuizKoller_0-1688582273609.png

If you want the user not to appear in total, just make a simple adjustment to the measure:

LuizKoller_1-1688582355747.png

 

 

2. Now for the total, it depends on what total you want.

If you want the total number of tickets regardless of the user, just add a count.

LuizKoller_2-1688582584327.png

* My BI is in Portuguese, but I think it's understandable.

 

 

 

Now, if you want the number of tickets only for the user who opened the most tickers, then you need a measure.

Measure Example for Count = 
VAR ExampleTable = 
TOPN(
    1,
    SUMMARIZE(
        zendesk,
        zendesk[Requester],
        zendesk[Category],
        "TotalRequirements", COUNTROWS(zendesk)
        ),
    [TotalRequirements],
    DESC
)


RETURN
IF(
    ISINSCOPE(zendesk[Category]),
    MAXX(ExampleTable, [TotalRequirements])
)


(I'm not putting a print of the result because the example data in another comment does not show any user who has the same ticket category more than once)

 

 

Hope it helps

This is shameful, a thousand apologies. 🙄

 

Rookie mistake. 😝

 

It's working smoothly.

 

Thank you so much.

adumith
Helper I
Helper I

Hello everyone, 

 

I have tried other options but unfornately I don't get it....

 

TopRequestersPerCategory = 
    SUMMARIZE(
        ADDCOLUMNS(
            zendesk,
            "TotalTickets", 1
        ),
        zendesk[Requester],
        zendesk[Category],
        "TotalTickets", SUM(zendesk[TotalTickets])
    )

 

adumith_0-1688130168756.png

 

 

TopRequestersPerCategory =
    ADDCOLUMNS(
        SUMMARIZE(
            zendesk,
            zendesk[Requester],
            zendesk[Category],
            "TotalTickets", COUNTROWS(zendesk)
        ),
        "Rank", RANKX(
            FILTER(
                ALL(zendesk),
                zendesk[Requester] = EARLIER(zendesk[Requester])
            ),
            [TotalTickets],
            ,
            DESC
        )
    )

 

 

adumith_1-1688130232683.png

 

Any ideas?

 

My goal is be able to determinate a list of the requesters and the categories in which they have the most tickets? In other words, the formula should search for each applicant which categories have the most tickets and how many tickets.

 

Thank you in advance, 

 

 

 

Ok folks,

I'm still investigating.

I found a tool called DAX Studio, where I can test the formulas and then if it does what I expect then I copy it to Power BI.

Well, it turns out that the formula in the tool works but not in Power BI, so I am definitely doing something wrong.

I have checked the table, the data structure, the column names and everything is fine.

Otherwise the formula would not work in DAX Studio.

DAX Studio

adumith_0-1688150944837.png

Power BI

adumith_1-1688150999488.png

 

Why?

 

What I'm doing wrong?

 

Thank you guys and sorry for be anoying.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.