Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys,
I need an index column that starts first, as soon as an object name is in another column If there is nothing in the column, nothing should be returned:
ObjectName | Index |
Object1 | 1 |
Object1 | 2 |
Object1 | 3 |
Object1 | 4 |
Object1 | 5 |
Object2 | 1 |
Object2 | 2 |
Object2 | 3 |
Thanks in advance
greetings Lukas
Hi, @Anonymous , it's fairly easy to achieve what you want in Power Query; you might want to try this,
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k/KSk0uMVSK1SGXbYSbHQsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ObjectName = _t]),
#"Sorted Rows" = Table.Sort(Source,{{"ObjectName", Order.Ascending}}),
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"ObjectName"}, {{"All", each Table.SelectColumns(Table.AddIndexColumn(_, "Index", 1, 1, Int64.Type), {"Index"})}}),
#"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", {"Index"}, {"Index"})
in
#"Expanded All"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hello @CNENFRNL I created the ObjectName Column with Dax (I get the Name form another Tabel) so I cant do this with Power Query
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
52 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
75 | |
58 | |
47 | |
16 | |
12 |