Forum Discussion
Anonymous
5 years agoNot applicable
Need help with M-Query in Advanced editor
Hi Community, I have Web As data source report . After working on m-query in advanced editor and applying lot of transformation steps (Combined list, Converting list to table, expanding columns e...
- 5 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
Source:
= Table.FromRecords( { [Data={null,#date(2020,1,1)}], [Data={null,#date(2020,1,2)}], [Data={null,#date(2020,1,3)}], [Data={null,#date(2020,1,4)}], [Data={null,#date(2020,1,5)}], [Data=#date(2020,1,6)], [Data=#date(2020,1,7)] } )You may add a new step as below.
= Table.TransformColumns(Source, {"Data",each if _ is list then List.Max( List.RemoveNulls(_) ) else if _ is date then _ else null } )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-alq-msft
5 years agoCommunity Support
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
Source:
= Table.FromRecords(
{
[Data={null,#date(2020,1,1)}],
[Data={null,#date(2020,1,2)}],
[Data={null,#date(2020,1,3)}],
[Data={null,#date(2020,1,4)}],
[Data={null,#date(2020,1,5)}],
[Data=#date(2020,1,6)],
[Data=#date(2020,1,7)]
}
)
You may add a new step as below.
= Table.TransformColumns(Source, {"Data",each if _ is list
then List.Max( List.RemoveNulls(_) )
else if _ is date
then _
else null
}
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Thanks Allan,
This really helped me a lot to sort out the issue.
G Venkatesh