Forum Discussion
Schedule Refresh Error due to Function used in Desktop
Hi everyone,
Greatly appreciate any help or guidance on this issue. We are using a Function (fGetDuration) from another table in our data model. All tables come from the same sql database (Practice Engine). Everything works just fine in Desktop, including data refresh. No problem pushing up to the Service either. (And before putting in this function, scheduled refresh worked in the Service as well for same tables from the same database.)
We are using a function to get table columns to code to a specfic color based on being in the "current" pipeline period. We want opportunities that have been created in the current period to be green, modified in the current period to be yellow, and red if modified 180+ days ago. The "current" period is typically 14 days but can be different due to when the pipeline meeting is held (this is updated/adjusted from Dynamics 365 / CRM).
The issue comes when we try to do a scheduled refresh in Service with the updated conditional column that has the fGetDuration function. I have included a screenshot of the code in Query Editor, and included below because the screenshot cuts off the last bit. The second photo is of the created Function (based on a different table from same database) in PBI Desktop that is then inserted into the code for another table/created column.
Any help is greatly appreciated! If there is a different idea to get this dynamic color coding to work, would greatly appreciate that too.
Thank you!
Katie
#"Renamed Columns11" = Table.RenameColumns(#"Extracted Days",{{"Age.1", "ModifiedAge.1"}}),
#"Row Coloring" = Table.AddColumn(#"Renamed Columns11", "Row Color", each if [Days] < fGetDuration() then "green" else if [Days] <= 180 then "white" else if [ModifiedAge.1] < fGetDuration() then "yellow" else "red"),
#"Row Hex Coloring" = Table.AddColumn(#"Row Coloring", "_*Row Hex Color", each if [Row Color] = "green" then "#90EE90" else if [Row Color] = "white" then "#FFFFFF" else if [Row Color] = "yellow" then "#FFDB44" else "#FA8072")