cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BlackRos
Level: Powered On

CDS - AddColumns where Lookups are replaced with Filterns with Filter which su

Hello,
I'm using PowerApps with CDS.
I need to replace the Lookups with some Filter in this piece of code to be able to get a TableMF enhanced. But I can't, after so many attempts. Can someone help me? Thanks in advance

ClearCollect(
TablePDA;
Filter(
AddColumns(
AddColumns(
AddColumns(
ObiettiviUPCol;
"Data Inizio PDA";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
'Data inizio'
);
"Data fine PDA";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
'Data fine'
);
"StatoPDA_Attivo";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
Stato
);
etc etc


1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: CDS - AddColumns where Lookups are replaced with Filterns with Filter which su

Hi @BlackRos ,

Could you please share a bit more about your scenario?

Do you want to add some new columns based on your ObiettiviUPCol data source with LookUp formula result?

 

Based on the needs that you mentioned, I think it is not necessary to add multiple AddColumns function to achieve your needs, instead, single one AddColumns function could achieve your needs.

 

I have made a test on my side, please consider modify your formula as below:

ClearCollect(
             TablePDA;
             Filter(
                    AddColumns(
                                ObiettiviUPCol;
                                "Data Inizio PDA";
                                LookUp('Piani di azione'; Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; 'Data inizio');
                                "Data fine PDA";
                                LookUp('Piani di azione';Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; 'Data fine');
                                "StatoPDA_Attivo";
                                LookUp('Piani di azione'; Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; Stato);
                                ...
                                ...
                   )
                   ...             /* <-- Specify your Filter formula here */
                   ...
             )
)

Please consider take a try with above solution, then check if the issue is solved.

 

More details about the AddColumns function, please check the following article:

AddColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: CDS - AddColumns where Lookups are replaced with Filterns with Filter which su

Hi @BlackRos 

You are making your formula more difficult than necessary.  Only one AddColumns() function is required,  The format should be 

ClearCollect(
TablePDA;
Filter(
AddColumns(
ObiettiviUPCol;
"Data Inizio PDA";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
'Data inizio'
);
"Data fine PDA";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
'Data fine'
);
"StatoPDA_Attivo";
LookUp(
'Piani di azione';
Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa;
Stato
);
etc etc
Community Support Team
Community Support Team

Re: CDS - AddColumns where Lookups are replaced with Filterns with Filter which su

Hi @BlackRos ,

Could you please share a bit more about your scenario?

Do you want to add some new columns based on your ObiettiviUPCol data source with LookUp formula result?

 

Based on the needs that you mentioned, I think it is not necessary to add multiple AddColumns function to achieve your needs, instead, single one AddColumns function could achieve your needs.

 

I have made a test on my side, please consider modify your formula as below:

ClearCollect(
             TablePDA;
             Filter(
                    AddColumns(
                                ObiettiviUPCol;
                                "Data Inizio PDA";
                                LookUp('Piani di azione'; Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; 'Data inizio');
                                "Data fine PDA";
                                LookUp('Piani di azione';Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; 'Data fine');
                                "StatoPDA_Attivo";
                                LookUp('Piani di azione'; Iniziativa = ObiettiviUPCol[@Iniziativa].Iniziativa; Stato);
                                ...
                                ...
                   )
                   ...             /* <-- Specify your Filter formula here */
                   ...
             )
)

Please consider take a try with above solution, then check if the issue is solved.

 

More details about the AddColumns function, please check the following article:

AddColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Users Online
Currently online: 297 members 6,146 guests
Please welcome our newest community members: