Calculating the row number with DAX

Hello,
Can somebody help me to obtain the row number in a calculated column using DAX (PowerPivot 2013) ?
I do not have any column that would contain unique values (would be easy in that case !). I just want to obtain a different value in each row.
Thank you.

Hi DP17000,
According to your description, you need to add a column with the RowNumber to your Pivot table by using DAX, right?
Based on my tested, we can use a ranks function to achieve your requirement.
=RANKX(case0305,[amount],[amount],0,dense)
Reference
https://msdn.microsoft.com/en-us/library/gg492185.aspx?f=255&MSPPError=-2147217396
http://ayadshammout.com/2013/02/19/dax-rankx-function-scenarios/
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How to display the rows number of times by giving the column values?

    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         SELECT 'krishna' NAME,     'hyd' LOC, 1 NUM FROM DUAL )
      SELECT T.* FROM T
      CONNECT BY ROWNUM <= NUM
    Expected output:
             venkatesh            hyd      2
             venkatesh            hyd        2
             prasad                 hyd        3
             prasad                   hyd      3
             prasad                   hyd      3
             krishna           hyd       1Edited by: Nag Aswadhati on Nov 1, 2012 12:34 AM

    Nag Aswadhati wrote:
    Hi All,
    I want to display the rows number of times as the value exists in num column in the below query
    Expected output:
    venkatesh            hyd      2
    venkatesh            hyd        2
    prasad                 hyd        3
    prasad                   hyd      3
    prasad                   hyd      3
    krishna           hyd       1Using Connect By:-
    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         select 'krishna' name,     'hyd' loc, 1 num from dual )
      select t.name, t.loc
      from t
      connect by level <= num
             and name = prior name
             and (prior sys_guid() is not null);
    NAME      LOC
    krishna   hyd
    prasad    hyd
    prasad    hyd
    prasad    hyd
    venkatesh hyd
    venkatesh hyd
    6 rows selected

  • How to get the row number

    Hi list,
    does any one know how I can get the row number the same as what I have in column rowno?
    thanks
    Arvin
    REATE   TABLE dbo.temptable
    ( y int  NOT NULL,
      e int not null,
      c int not null,
      rowno int not null)
    /* insert values  */
    INSERT INTO dbo.temptable(y,e,c,rowno ) VALUES
    (1,1,1,1),
    (1,1,2,1),
    (1,1,3,1),
    (1,20,1,2),
    (1,20,2,2),
    (1,20,3,2),
    (1,3,1,3),
    (1,3,1,3),
    (2,1,1,1),
    (2,1,1,1),
    (2,2,1,2),
    (2,2,1,2);

    You may update your rownumber column with Column "e".
    But why do you duplicate your data? May be there is no particular reason, you may be wasting space for it
    Try the below:
    CREATE TABLE dbo.temptable
    ( y int NOT NULL,
    e int not null,
    c int not null,
    ronum int null)
    INSERT INTO dbo.temptable(y,e,c ) VALUES
    (1,1,1),
    (1,1,2),
    (1,1,3),
    (1,20,1),
    (1,20,2)
    select * from temptable
    update dbo.temptable Set ronum=e
    Select * From dbo.temptable
    DRop table dbo.temptable

  • Retrieving the row number of a specific record from the results of a MySQL query

    I want to create a MySQL query that will return a list of
    records, and then retrieve the row number of a record with a
    specific ID. How can I do this?
    *server-side script: PHP

    <?php
    $i = 0;
    do {
    $i++;
    } while (mysql_fetch_assoc($rsWhatever) &&
    $row_rsWhatever['ID'] !=57);
    echo "TADA -" . $i;
    ?>
    (assuming that ID is numeric, and that the test value
    actually exists in the
    database)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "AngryCloud" <[email protected]> wrote in
    message
    news:g4e6ck$hrb$[email protected]..
    >I will use this scenario for an example:
    >
    > I want to know how far down the list I will find the ID,
    '57'.
    >
    > So I manually look at the list of results and see it is
    the 25th record
    > down
    > on the list.
    >
    > How do I get my PHP script to get this number (25)
    automatically?
    >

  • Display Row Number with JTable

    Hi everybody,
    I try to build a spreadsheet with Java and Swing. I use Jdk1.2.2 and I looking for display the row Number on the left (Excel - like). I can't fiugre out how to implement this.
    Anyone can give me some help?
    Bye
    Mirko

    Hi Sciak!
    This is what you are looking for ('Row Header' sample, including source code):
    http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
    Home page:
    http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
    CU,
    Jan

  • To fill in the material number with item category u201CBu201D for Framework Order.

    The use of framework orders (also referred to as blanket purchase orders)  enables you to procure a variety of materials or services from a vendor up to a predefined maximum value (the value limit).
    Instead of a specific delivery date, you specify a validity period for the order.
    Goods receipts or the entry and acceptance of services performed are not necessary in the case of a framework PO and limit items.
    The invoices are posted directly with reference to the purchase order, provided that the specified value limit is not exceeded. When the value limit of the PO is reached, or the validity period is exceeded, the system issues a warning message. It is possible to book the invoices, but these are blocked for payment.
    During the phase of service performance, the cumulative u201Cactual" values (for the services actually performed) are continually updated in the underlying purchase. This enables you to monitor the progress of a procurement project on an ongoing basis. By comparing the "actual" value with the total value, you can always obtain an overview of the degree to which a budget for unplanned services or materials has been exhausted (i.e. see whether predefined limits have been reached or nearly reached).
    So with the Framework Order type (FO) and item category u201CBu201D you get the error that it is not allowed to fill in the material number with item category u201CBu201D.
    Please suggest me the possible solution to fill in the material number with item category u201CBu201D for Framework Order.
    Best Regards,
    Harisha

    The Framework order type is specialy defined for lesser value procurements (ex: stationeries, cleaning services ....) which are all not worthy to create Material Master at all.
    If you are very sure to fill the Material number, then proceed with some other document type.
    In what circumstances you want to put material number in FO order?
    Karthi.

  • How can I get the row number of display automatically on a table?

    I have a table of measurements, and I would like the row number to be displayed on each row. The challenge is that each time I run the program, the total number of rows will be different, so I would like the numbers to update every time I run the program based on the current number of rows.
    I have attached a picture to illustrate what I am trying to do.
    Solved!
    Go to Solution.
    Attachments:
    picture of table.JPG ‏70 KB

    Find the attached example (saved in version 2009), and you can extract what you need for your code...!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Example (Enter Row Header).vi ‏12 KB

  • TableView -- get the row number of the top most current visible row

    Is there any way to get the row number of the top most visible row, and or bottom most visible row in TableView?

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • Retrieving the row number where a certain value exists

    Hi,
    I wanted to find out if there is a way to retrieve the row number of a row where a certain value exists. For example, if I had a query
    Create or replace Procedure p1
    IS
    v_Stmt varchar2(100);
    BEGIN
    v_Stmt := 'Select * from emp where lname = 'Davis'';
    Execute Immediate v_Stmt;
    END;
    SQL> exec p1;
    Then, I would like to find out that this name is on row 3.
    Can anyone tell me how this can be done?
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    theres is no rownum related to a particular row. A rownum is a pseudocolumn which value may be different for the same row depending on the query you do. What you can use is the rowid which is the row's address.
    HTH
    Maurice

  • About the row number of the datagrid[Flex 2.0 beta3]

    I want to add a column to the datagrid,which will indicates
    the row number.Who can tell me how to do it?
    And how to keep the number's sequence unchanged when the
    header of one of other columns is cliked to sort the
    data?

    If I understand this correctly. Then would it not make more
    sense to say in
    the LiveDocs --
    makeObjectsBindable - After the remote call (RPC, HTTP, SOAP,
    etc) returns
    its value. Flex tries to automatically convert the result
    into an
    ArrayCollection (if it looks like an array, even if it was
    XML) [Or
    others???] format. This automatic conversion controlled by
    the
    makeObjectBindable property. If false, Flex does not attempt
    the conversion
    and the result will be in (xml?) format.
    "peterent" <[email protected]> wrote in
    message
    news:eali1i$1q9$[email protected]..
    > Results that come back which look like Arrays will be
    turned into
    > ArrayCollections automatically. Since most people
    immediate turn an Array
    > into
    > an ArrayCollection, we went ahead and did it for you.
    Try getting rid of
    > your
    > new ArrayCollection in the result handler.
    >

  • I can't get the row number of the current selection

    Hi all,
    How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.
    I've tried in many ways, but unsuccesfully.
    Thank's in advance.

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • How can i know the row number of my table is being modified?

    HI all,
    I have a table in my web dynpro and several columns as checkbox... I put an event OnToggle in these columns.
    Do you know any way to get the row or the row number?
    If i use the method get_static_attributes return to me the selected row not the modified.
    Thanks in advance !

    EDIT: thanks ! is solved, i need to pass CONTEXT_ELEMENT' in the  <ELEMNT_NAME>
    This is my code:
    DATA table_element TYPE REF TO if_wd_context_element.
      DATA row_index TYPE i.
      table_element = wdevent->get_context_element('CONTEXT_ELEMENT').
      IF NOT table_element IS INITIAL.
        row_index = table_element->get_index( ).
      ENDIF.
    Edited by: Husalban RM on Sep 15, 2010 4:53 PM

  • HT4061 Is there another way to find the serial number with only your apple ID and password because apparently I never backed up my iPhone 5?

    Is there another way to find the serial number with only your ID and password because apparently I never backed up my device on my computer?

    If you registered it with Apple, you could try:
    supportprofile.apple.com
    Use your Apple ID and password to log in

  • My ipod touch4 has been stolen. i have the serial number with me. is there any way to find it?

    my ipod touch4 has been stolen. i have the serial number with me. is there any way to find it?

    The SN will only help identify the iPod as yours if it is recovered.
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have to iPod play a sound via iCloud.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing
    Reporting a lost or stolen Apple product                               
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • To find the IDOC number with SOBID information

    Hi Experts,
      I have an employee information like VARYF, SEQNR, AEDTM, UNAME, ITXNR, SCLAS, SOBID and PROZT.
    Some outbound IDOC number has stopped its process to the SRM system.
    I want to know thw IDOC number.
    Please help me in finding out the transaction to find the IDOC number with the SOBID or OBJECTID information.
    Thanks in Advance.
    Ramya Sekar

    Look at transaction WE09.
    Other IDOC information can be found through WEDI.

Maybe you are looking for

  • Invoice Discount In Oracle Receivable

    Hi, Any one knows how can i deduct invoice discount in oracle receivable. If any one knows please let me know. Regards, Yasir

  • What OS will work with my eMac

    I had bought this eMac off ebay, and just got it, it had a clean wiped hard drive, and I had bought a mac os x 10.0.3 disc, but every time I go to install it, it says that it had quit and hit enter to restart( Might be because it says "Instant up-to-

  • Solaris 11.2 Zones

    Hi All, I've been battling with creating/installing a zone. I've setup all my zone configs but when I try to install the my zone. this is the error message I get: 'NoneType' object has no attribute 'bind' And when I check the install log, this is wha

  • How to use ICC based colorspace

    hello, The question is how to define a color in ICC based colorspace ? I tried with gState.strokeColorSpec.value.color array and it work fine when my CIE based colorspace is CMYK but how to do it when colorspace can be CMYKOG or RGB ... ? Regards, Wi

  • Nokia N80 Web Browser: "Web already in use"?

    Just got my nokia N80, connected to my WLAN perfectly, I managed to have a couple of hours browsing the internet using the Web browser found under "My Own", I wanted to see if msn Web Messenger would work, after the login the web browser crashes. Now