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
-
I have an old MacBook (Mac OSX 10.5.8) with iPhoto '08. Is there any way to back up not only the photos, but the way I have organized them into events and labeled them?
Yes. Back up the Library.
Most Simple Back Up:
Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store -
Is there any way to attach an action to the current tab bar you are in? If so, how ?
I am using storyboards.
CheersJeff:
Look at Cyclosaurus' post in this topic: http://discussions.apple.com/thread.jspa?messageID=9273769#9273769. It may address what you're wanting to accomplish.
OT -
IS there any way to pass a value in the view as a variable
Hi
I have 2 views and 1 view on top of them that calls the 2 views e.g.
View1
select ename, deptno, date from emp;
View2
select sal, date from salary;
view3
select v1.ename, v1.deptno, v2.sal from view1, view2 where date = SOME VARIABLE;
sql query
Select * from v3 where date='10-AUG-2007'';
ITs taking a while is there any way that I can define the V3 as follows
view3
select v1.ename, v1.deptno, v2.sal from view1, view2 where v1.date = SOME VARIABLE and v2.date=SOME VARIABLE;
and then at the sql plus level can i use it like
I have 2 views and 1 view on top of them that calls the 2 views e.g.
View1
select ename, deptno, date from emp;
View2
select sal, date from salary;
view3
select v1.ename, v1.deptno, v2.sal from view1, view2 where date = SOME VARIABLE;
sql query
Select * from v3 where date='10-AUG-2007''; can this date be passes as a variable in side the view definition.Setting up a view which contains a substiutution variable
-
I have a "Contact" organization issue I need help with. I organize multiple customers under their account affiliation. I place the people with their contact info under each account name by their dept/role in the notes section of their account. I am looking to be able to directly dial / email from this info in yet notes section located within a contact. On Blackberry, the notes area entered in a contact can connect directly but on the iPhone those numbers/emails are inactive. I am trying to avoid having to create each of these individuals as a separate contact and keep them under their account affiliation. It is easier to find them. This does not seem like that complicated of a request and hoping someone can tell me how or share an app that will enable the "notes" within a contact be "active". Hope this makes sense.
I seem to recall that this question has been asked before and I'm pretty sure that the answer is that you can't do what you want to do with the native contact app. However, there are lots of contact apps out there that pull from the built app's data but have other features. Perhaps one of them would meet your needs.
-
heey guys whats up listen i have a problem i lost my iphone and it has all my pic's and some information that i really really need it what should i do .... is there any way that i can get back the i phone ??? please help me
You can look for it.
If you find it, you will have it back.
If you had find my iphone activated on the iphone BEFORE it was lost, then you may be able to track it. -
I purchased some movies off iTunes from my account (but from my father IPad) to download as a gift,
but didn't realize he can not view if not logged in with my account.
Is there any way to save directly to the IPad (regardless of account) so he can view?
Or transfer to his account?
Or is any was to cancel the recent purchase if can not transfer as I will not watch these myself?sure pretty simple. make a backup of your current settings
http://support.apple.com/kb/HT1766?viewlocale=en_US
then restore device from old backup you need pics off of
then import pics to computer
http://support.apple.com/kb/HT4083
you may need to save pics to camera roll first
then restore the new backup and sync pics back to phone via itunes
Peace, Clyde -
hello i got problem. iphone doesnt restore even using itunes.its stuck in recovery mode and i cannt do anything with it.error 1015 is there any way to reinstall software even if itunes cannot deal with it ?
Usually this error occurs when trying to downgrade the iOS or in a previously jailbroken phone. In this case, you cannot get help here. The internet and Google are your best friends.
-
I have a new mac book pro which i use in england but I need to use German charachters frequently, is there a way of having both visable on the keyboard?
For example so that I can just press shift or another key to get the German character.Some may already exist, but you will have to learn them. On my old system these can be found through keyviewer.app For example, if I press option+s I get ß Umlaut is a bit cumbersome as option+u then the actual letter. It may be possible to bind a key to do this function, possibly through System Preferences > Keyboard > Shortcuts
I have old, old references for utilities that let you rebind keys to other functions, and you would have to see if they have modern equivalents.
Ukelele Mac OS X Keyboard Layout Editor - http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele - mostly useful for character, not function mapping.
Check Butler, ikeys, quickeys or Spark -
i lost my appletv remote & can no longer connect to it with my iphone app. is there any way that i can reconnect with my iphone app without having to buy a new remote?
Doubtful - why did the Remote app lose connection?
-
Is there any way to get my reminders (from the new iPhone app) to sync with something on my laptop (Mail, iCal, some other desktop app)?
Yes, if you have iCloud set up on your phone and computer, then reminders will be synced through iCal.
-
My iPhone says that my charger is not supported, but it's the charger that came with my phone. Is there any way I can solve this issue?
Try cleaning out the phone's port, of pocket fluff and such. Carefully. And check the mains adapter similarly, but less likely.
-
I need to transfer up to two hundred Pages and Keynote files from my macbook running on Mac OS X 10.6.8 to my PC running windows. Is there any way I can convert all of the files to word-friendly documents as a batch change or will I have to open each individual file and re-save it as a word-friendly file?
I need to transfer up to two hundred Pages and Keynote files from my macbook running on Mac OS X 10.6.8 to my PC running windows. Is there any way I can convert all of the files to word-friendly documents as a batch change or will I have to open each individual file and re-save it as a word-friendly file?
-
I was given an 80gb ipod classic formatted with mac os. Is there any way to connect it to my windows pc so I can transfer the song to my library? When I try to connect to my pc I get a message asking me if I want to format the drive. I want to try to save the 15000 songs that are already on the ipod. Any suggestions?
The iPod and iTunes are designed so that you cannot transfer music on an iPod to another iTunes Library. This is because the 15,000 songs do not belong to you and you have no legal right to keep them.
-
I have two iPhones synced with the same Apple ID and so the contacts are being shared in both of them. Is there any way to revert this?? The reason is that if I delete some contact from one device then it automatically erases from the second one as well
Yes, you stop using the same Apple ID under Settings > iCloud.
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
-
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