Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Ncio
Helper II
Helper II

Custom error messages?

Hello, 

 

One of my data source is an excel spreadsheet updated by the users. It's not very reliable and often generate error during the dataset refresh. 

 

It's often the same steps that fails and I'd like to improve the error messages to be able to send the error report directly to the users. Is there any ways to do that? 

 

Example:

  • Current error message: Error: DataFormat.Error: We couldn't parse the input provided as a DateTime value. Request ID: zzzz Activity ID: zzzz
  • Custom error message: Update error: Please check the date column in the file ZZZ.xlsx (link).

 

Thank you.

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

Hi @Ncio,

You can throw custom error messages from PQ like this

 

try (StepWithPotentialError) otherwise error Error.Record("This is a custom error","I just love error messages")

 

SpartaBI_0-1652437018699.png


try (X) otherwise Y returns X, unless X is an error. In the latter case, it returns Y.

error raises an error. You can write

 

error "I just love error messages"

 

or use a proper error record with

 

error Error.Record("This is a custom error","I just love error messages")

 

 

Here is the email I've got from the PBI service

SpartaBI_1-1652437376212.png




2022-05-09 22_36_04-Power BI Workspace Datasets License Permissions - Microsoft Power BI Community.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png  SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

 

 

 

View solution in original post

2 REPLIES 2
SpartaBI
Community Champion
Community Champion

Hi @Ncio,

You can throw custom error messages from PQ like this

 

try (StepWithPotentialError) otherwise error Error.Record("This is a custom error","I just love error messages")

 

SpartaBI_0-1652437018699.png


try (X) otherwise Y returns X, unless X is an error. In the latter case, it returns Y.

error raises an error. You can write

 

error "I just love error messages"

 

or use a proper error record with

 

error Error.Record("This is a custom error","I just love error messages")

 

 

Here is the email I've got from the PBI service

SpartaBI_1-1652437376212.png




2022-05-09 22_36_04-Power BI Workspace Datasets License Permissions - Microsoft Power BI Community.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png  SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

 

 

 

thank you!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors