Need help with a calculated column - is there any way to reference a value in the current row?

Hey guys,
I'm a bit of a DAX newbie, and I'm running into a block. I'm creating a Power View report about IT tickets. We are going to be creating a cube to automate the data soon, I'm currently working with a flat Excel Data Table of data to demonstrate the Power
View reporting capabilities to the team. I need the default display to show the top 4-5 items basked on the Ticket Count. The three applicable columns I'm using are the TicketID, the ContactReason, and the AssetCategory - all three are
text. One slide will show the top five Contact Reasons by Ticket Count, and the other will show the top five Categories by Ticket Count. The users will see this default view, but will be able to change it to see differently ranked items or can clear the
ranking slicer altogether.
What I've accomplished so far is to create the Calculated Field [Ticket Count] = COUNTA(Table1[TicketID])
And 2 other calculated fields:
[Contact Rank] = RANKX(ALL(Table1[ContactReason]),[Ticket Count],,,DENSE)
[Asset Rank] = RANKX(ALL(Table1[AssetCategory]),[Ticket Count],,,DENSE)
If I were creating a Pivot Table, this would be great. These fields calculate everything the right way. The problem is, I need to have a Rank slicer on each slide and the calculation by itself contains no data - with no data, there's nothing to slice. I
realized I need to actually have columns of data so I can create a slicer. I need each row of the table to show the same [Contact Rank] for every instance of a particular ContactReason (and the same for the [Asset Rank] and AssetCategory).
The RANKX formulas pasted into the Calculated Column section only show a value of 1 - with no Pivot table summarizing the fields, it's counting each row's ticket once, giving every line the tied Rank of #1.
I've solved the problem in Excel by creating 2 Pivot Tables on a separate sheet that have the data field and the calculated field for ContactRason and AssetCategory. Then on my Excel Data Table, I've added two columns that do a VLOOKUP and pull over a the
Calculated Rank from each Pivot Table that match the ContactReason and AssetCategory fields. This works on the flat Excel Data Table now, but will not be a solutions when we start pulling the data from the cube (and there is no flat table).
What I think I need is an Expression for the RANKX formula that can give me, for each row, the count of all of the times a ContactReason shows up in an entire column. There's only about 100,000 lines of data and each ContactReason or AssetCategory
may show up several thousand times. But if I can get the expression to return that count, then the RANKX formula should work in the Column. If it wasn't a DAX formula, I'd use a COUNTIF and say 'Count the entire ContactReason column anytime it's equal to the
ContactReason on THIS row', but in DAX I don't know how to reference a single value in a row. I've tried the CALCULATE() formula, but it seems like the filter needs a specific value, and doesn't work on a dynamic "cell" value.
Any help would be greatly appreciated! (I hope it all makes sense!)

If I've understood you correctly then the ALLEXCEPT function may be what you're after and it could be applied in a similar way to the following...
=
RANKX(
ALL(Table1),
CALCULATE(
COUNTROWS(table1),
ALLEXCEPT(Table1, Table1[ContactReason])
DENSE
If this has missed the mark, would it be possible to clarify the requirement further?
Regards,
Michael Amadi
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
Website: http://www.nimblelearn.com
Blog: http://www.nimblelearn.com/blog
Twitter: @nimblelearn

Similar Messages

Maybe you are looking for

  • File adapter in comm.channel green, but no message collecting

    Hello, looks like this is something really at the roots. Ok, we are in NW2004s PI 7.0. One IDOC process is successfully implemented. Now we started with a file to file communication! File sender adapter is configured and shown in status green in comm

  • Webutil Signing

    Im working in Linux RedHat 3. One question. I have signed the 2 files , webutil.jar and jacob.jar, with the jarsigner option of the jdk include in my Developer Suite Release 10g. (forms 9.0.4). But when I tried to run a form with the webutil pakage i

  • How to call a CRM transaction from WDA  component

    I have requirement where i need to open the CRM transaction CRMD_BUS2000126 from WDA with the object id selected in the context. To be more specific all i need to do is to open the activity screen of a particular give activity number from a WDA compo

  • Issues in CHARM, pls help

    Hi,           i have setup charm,created and transported a transport request succcessfully thru charm.now as there was problem in my development system i removed it and added another system as development in TMS and maintained SMSY also .i created an

  • 10.6.4 Combo Update - Kernel Panic on 1st Gen Mac Pro with 8GB and ATI 4870

    Hi, I installed the 10.6.4 combo update last night and now my system constantly kernel panics. It was fine with 10.6.3 for months and never kernel panicked. I have 4 x 2GB FB-Dimms and a ATI 4870 card. The system is also only showing one display and