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
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
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.

Top Solution Authors
Top Kudoed Authors