Forum Discussion
SAP BW, Dates as Text, and Incremental Refresh
Quick update,
I tried writing a function to convert DateTime parameters (RangeStart and RangeEnd) in SAP BW format "DD.MM.YY". Using this I could manage query folding (cube icon visible). Configured incremental refresh. However, after deployed to Power BI service, the refresh takes forever and fails eventually! I've potentially figured out another way using Power BI Dataflow. I will post here again soon.
Here is the code:
//Code start
let
source = (x as date) =>
if Date.Day(x) < 10 and Date.Month(x) < 10
then "0" & Text.From(Date.Day(x)) & "." & "0" & Text.From(Date.Month(x)) & "." & Text.From(Date.Year(x))
else
if Date.Day(x) < 10
then "0" & Text.From(Date.Day(x)) & "." & Text.From(Date.Month(x)) & "." & Text.From(Date.Year(x))
else
if Date.Month(x) < 10
then Text.From(Date.Day(x)) & "." & "0" & Text.From(Date.Month(x)) & "." & Text.From(Date.Year(x))
else Text.From(Date.Day(x)) & "." & Text.From(Date.Month(x)) & "." & Text.From(Date.Year(x))
in
source
//Code end
Cheers!