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
automated_user
Frequent Visitor

Looking for a value in a column and adding data another

Hi, 

I have one table here and no other tables: 

automated_user_0-1665615309590.png

This Table has a column called "PseudoNo" Column and seperates the string by the "," .  The "RowCount.PseudoLines" column listed here:

automated_user_2-1665615791499.png

Is the outcome of the seperated string that when broken up has 1 value "TSF24" and 2 Values of "TS12BLW". 

 

So for each value in "PartNum" search for it in the  "RowCount.PseudoLines" column, if there's a match, add the "PartDescr" to the "PartDesc" column. 

 

I was able to do it in Power Query using this function here:

 

let a=Table.Buffer(Table.Distinct(#"Added Custom7","PartNum")) in Table.TransformColumns(#"Added Custom7",{"ID",each Table.AddColumn( _,"PartDescr",each a {[PartNum=[PseudoLines]]}?[PartDescr]?)})

 

but the table I have is over 450,000 records and was loading the data very slowly. So is this possible in DAX?

 

Thanks.

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @automated_user ,

 

'If you can do it in M and DAX, then do it in M. I’m a big advocate of pushing transforms and calculations as far upstream as possible. Ideally you leave DAX to do the absolute minimum – especially when data volumes get large.'

M or DAX? That is the Question!

 

The M function is better at ETL while DAX is better at counting values. As a rule of thumb, if I want an entity column, I also tend to prefer to do it in PQ.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hi @v-cgao-msft ,

Thanks for the reply and suggestions! Is there a better way to calculate in M for this function below then: 

 

let a=Table.Buffer(Table.Distinct(#"Added Custom7","PartNum")) in Table.TransformColumns(#"Added Custom7",{"ID",each Table.AddColumn( _,"PartDescr",each a {[PartNum=[PseudoLines]]}?[PartDescr]?)})

 

for what I'm trying to do below, The "ID" column is the nested table within the table:

automated_user_0-1665754673027.png

The function I use now is extremely slow when waiting to apply the changes (3 hrs+)

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.