Forum Discussion

nleuck_101's avatar
nleuck_101
Continued Contributor
3 years ago

Issues trying to use new DAX function ROWNUMBER

Hello All,

 

Has anyone else tried to use the new DAX functions and receive the following error "an unexpected error has occurred"? I'm trying to use ROWNUMBER but nothing I do to try and fix it works. Then when I try to delete the measure, I get another error that tells me to close and restart Power BI desktop.

 

Thanks,

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi nleuck_101 ,

    Could you please provide the whole formula of measure which include ROWNUMBER function and some sample data involved in the measure? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    Best Regards

    • nleuck_101's avatar
      nleuck_101
      Continued Contributor

      Hello Anonymous 

       

      Here is some sample data that I'm working with. I want to have a row number count that is ordered by Attendance % in highest-lowest and then Length of Service (Days) highest-lowest.

       

      BadgeLength of Service (Days)Attendance %
      100256100.00%

      101

      624100.00%
      102400100.00%
      103463100.00%
      10438999.60%
      10528199.56%
      10632299.00%
      10740098.92%
      10850498.92%

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi nleuck_101 ,

        You can achieve it in Power Query Editor, please check the following codes and screenshot. You can find the details in the attachment.

        let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc5RCsAgCAbguwh7izBNl2cZ3f8a06LG6EXkA//f54GCCAlI1KfvGfGCnsKLi1I9nFzquPo7hysfHgnczKdZ1s0Sta1MFl0cfzDR5C/k3qXWstHi5iCjYXF/AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Badge = _t, #"Length of Service (Days)" = _t, #"Attendance %" = _t]),
            #"Changed Type" = Table.TransformColumnTypes(Source,{{"Badge", Int64.Type}, {"Length of Service (Days)", Int64.Type}, {"Attendance %", Percentage.Type}}),
            #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Attendance %", Order.Descending}, {"Length of Service (Days)", Order.Descending}}),
            #"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type)
        in
            #"Added Index"

        Best Regards