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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors