Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Dax Index column Filter after name

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:

ObjectNameIndex
  
  
Object11
Object12
Object13
Object14
Object15
  
Object21
Object22
Object23
  

 

Thanks in advance

 

greetings Lukas

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

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"

Screenshot 2020-11-19 160139.png


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!

Anonymous
Not applicable

Hello @CNENFRNL I created the ObjectName Column with Dax (I get the Name form another Tabel) so I cant do this with Power Query

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.