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

Indivual value instead of whole list

My Code:

 

let
Source = Excel.Workbook(File.Contents("C:\Users\B.Feichtlbauer\Documents\PowerBI_Test\ExportSelectedCmdbCis(2).xlsx"), null, true),
CMDB_Sheet = Source{[Item="CMDB",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(CMDB_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"CiGroup_Title", type text}, {"CiType_Title", type text}, {"CreatedAt", type datetime}, {"DeliveryDate", type any}, {"Description", type any}, {"EquipmentID", type any}, {"GWGID", type any}, {"Attributes_Overview", type any}, {"InvoiceNumber", type any}, {"LeasingCi", type logical}, {"LeasingComments", type any}, {"LeasingExpiration", type any}, {"LeasingReminder", Int64.Type}, {"LocationInformation", type any}, {"MiscellaneousInventory", type any}, {"PurchaseDate", type any}, {"PurchasePrice", type any}, {"Title", type text}, {"WarrantyUntil", type any}, {"Number_(String)", type text}, {"Person_Title", type text}, {"State", type text}, {"Asset_State", type text}, {"Server_Detail_Operating_System", type any}}),

#"search for MAC" = (list) =>
let

    Macs = List.Select(list, each List.Count(Text.Split(_, ".")) = 4 or List.Count(Text.Split(_, ":")) = 6),

    First = if Macs <> null then List.First(Macs) else "no MAC"

in
    

var = Table.SelectColumns(#"Promoted Headers", "Attributes_Overview" ),


#"Added Custom" = Table.AddColumn(#"Changed Type", {"MAC_Addresse"}, each #"search for MAC"(Text.Split(each var, "#(lf)"))),
    MAC_Addresse = #"Added Custom"{11}[MAC_Addresse]

in
MAC_Addresse

 

 I only need the indivual field of the column not the whole thing how can I change this?

1 ACCEPTED SOLUTION
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Anonymous , 

 

Was the other post you raised resolved?

 

To get a value from a particular row and column:

Syntax = TableName[ColumnName]{RowIndex}

 

Row index count from 0

 

Example:

KT_Bsmart2gethe_1-1657886326868.png

 

To get Alphabet E: 

Source[Column1]{4}

KT_Bsmart2gethe_2-1657886388228.png

 

Regards

KT

View solution in original post

2 REPLIES 2
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

HI @Anonymous ,

 

Do you need to write M code to get something from CMDB?

What about you using the standard function from the toolbars?

 

Regards

KT

KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Anonymous , 

 

Was the other post you raised resolved?

 

To get a value from a particular row and column:

Syntax = TableName[ColumnName]{RowIndex}

 

Row index count from 0

 

Example:

KT_Bsmart2gethe_1-1657886326868.png

 

To get Alphabet E: 

Source[Column1]{4}

KT_Bsmart2gethe_2-1657886388228.png

 

Regards

KT

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.

Top Solution Authors
Top Kudoed Authors