Forum Discussion
Cannot force a semantic dataset to fail
- 1 year ago
Looks like it was just a transient issue on that day. The dataset is now failing correctly in Power BI Service with no change in the script.
Hi cath1ynn ,
Thank you for reaching out to Microsoft Fabric Community.
I have created a validation column and thrown error if the count is greater than 0. Below is working in both power bi desktop and power bi service. Please find below screenshot for reference. Also attached the pbix file for reference.
let
Source = Sql.Database(server, databasename),
dbo_vwcustomer = Source{[Schema="dbo",Item="vwcustomer"]}[Data],
InvalidDates = List.Select(dbo_vwcustomer[csutomerdate], each Date.From(_) <> Date.From(DateTime.LocalNow())),
ThrowError = if List.Count(InvalidDates) > 0 then error "Dataflow not refreshed today" else dbo_vwcustomer
in
ThrowError
Screenshot from service:
Screenshot from desktop:
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks & Regards,
Rekha,
CustomerSupportTeam.