Forum Discussion

adumith's avatar
adumith
Helper I
3 years ago
Solved

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:

 

 

Any ideas?

 

Thank you,

  • adumith's avatar
    adumith
    3 years ago

    Thank you for your reply.

     

    However, it's returning this error:

     

     

11 Replies

  • 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])
        )

     

     

     

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

     

     

     

    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, 

     

     

     

    • adumith's avatar
      adumith
      Helper I

      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

      Power BI

       

      Why?

       

      What I'm doing wrong?

       

      Thank you guys and sorry for be anoying.

       

  • 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"
    • adumith's avatar
      adumith
      Helper I

      Thank you for your reply.

       

      However, it's returning this error:

       

       

      • LuizKoller's avatar
        LuizKoller
        Resolver I

        Hello!

         

        Looks like its missing the name of the measure,

         

        "VAR TABLE =" is a Dax Function

         

         

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

    • adumith's avatar
      adumith
      Helper I

      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,

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

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