web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data Validation and Er...
Power Apps
Answered

Data Validation and Error Handling in PowerQuery

(0) ShareShare
ReportReport
Posted on by 86

Hello people,

 

i do have a source dataset that is generated from user inputs and therefore need to be validated before i can pass the dataset for analyzing.

 

There are mostly two possible type of errors:

- logical erros ( [Field1] = 0, [Field2] <> 0)

- lookup errors ([Field3] value not in lookup/ list

 

I wrote a powerquery M script that validates the data in three steps.
1.  "if then" statements  to find logical erros, and "Table.Contains" functions to find data thats not in the lookup tables.

 

i.e.
E20 = if [Field1] = 0 and [Field2] <> 0 then 20 else null,

E21 = if [Field3]  = x and [Field4] <> y then 21 else null,

E22 = if Table.Contains(tab_categories, [category = [out_category]]) = false then 22 else null,

 

2.  create a result list of all the conditions/ if clauses and remove null values

 

results = List.RemoveNulls({E20,E21,E22)

 

3. Translate those results into error messages by looking up each element of the result list in a tab_errorcodes and combine the texts:

error_message = Text.Combine(
List.Transform([results], each tab_errorcodes[ErrorMessage]{List.PositionOf(tab_errorcodes[ErrorCode], _,0)})
)

 

 

The script has to handle approx. 2k Datarows but seems to be very slow and produces timeout errors at some point.
I am looking for tips/ hints to learn new ways/ best practices to get the task done and would love to hear some feedback to my approach.

Greetings,
S

Categories:
I have the same question (0)
  • Sebastian030 Profile Picture
    86 on at

    Hi Gao,
    thank you for your Feedback and the input regarding the table buffering.

    I will look to implement table buffering in my solution and trying to imporve my overall flow setup.
    Greetings,

    S

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard