Forum Discussion
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
- AnonymousNot 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_101Continued 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.
Badge Length of Service (Days) Attendance % 100 256 100.00% 101
624 100.00% 102 400 100.00% 103 463 100.00% 104 389 99.60% 105 281 99.56% 106 322 99.00% 107 400 98.92% 108 504 98.92% - AnonymousNot 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