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
Marc-Alexis
Frequent Visitor

incremental refresh based on a dates stored with the YYYYMMDD INT format

Hello everyone,

I am trying to activate the incremental refresh on a table “FMT_Reporting_V2V_GuestHistoryDaily”  based on a dates saved in a column “Revenue date” in the format YYYYMMDD as whole numbers, stored and imported from a MySQL database with the INT format YYYYMMDD.

I have set RangeStart as following:

  • Type: Date/Time
  • Required: unchecked
  • Suggested Values: Any value
  • Current value: 01/01/2017 00:00:00

And RangeEnd as following:

  • Type: Date/Time
  • Required: unchecked
  • Suggested Values: Any value
  • Current value: 12/12/2050 00:00:00

Here is my current query:

let

    Source = MySQL.Database("10.203.1.116", "FMT_Reporting", [ReturnSingleDatabase=true]),

    FMT_Reporting_V2V_GuestHistoryDaily = Source{[Schema="FMT_Reporting",Item="V2V_GuestHistoryDaily"]}[Data],

    #"Filtered Rows" = Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd)),

    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rev_Room_Net_LC", "Rev_FB_Net_LC", "Rev_BQT_Net_LC", "Rev_SPA_Net_LC", "Rev_Ski_Net_LC", "Rev_Other_Net_LC"})

in

    #"Removed Columns"

When trying to apply the query I get into the following error message:

Apply query changes

FMT_Reporting V2V_GuestHistoryDaily

Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [Expression.Error] We cannot convert a value of type Function to type Logical.. '.

 

Any idea on what needs to be changed?

Thanks for you help!

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Marc-Alexis ,

 

In the step of "Filtered Rows", there is an extra "each". Please remove it to have a try.

 

= Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd))

 

 

 

let

    Source = MySQL.Database("10.203.1.116", "FMT_Reporting", [ReturnSingleDatabase=true]),

    FMT_Reporting_V2V_GuestHistoryDaily = Source{[Schema="FMT_Reporting",Item="V2V_GuestHistoryDaily"]}[Data],

    #"Filtered Rows" = Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd)),

    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rev_Room_Net_LC", "Rev_FB_Net_LC", "Rev_BQT_Net_LC", "Rev_SPA_Net_LC", "Rev_Ski_Net_LC", "Rev_Other_Net_LC"})

in

    #"Removed Columns"

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Marc-Alexis ,

 

In the step of "Filtered Rows", there is an extra "each". Please remove it to have a try.

 

= Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd))

 

 

 

let

    Source = MySQL.Database("10.203.1.116", "FMT_Reporting", [ReturnSingleDatabase=true]),

    FMT_Reporting_V2V_GuestHistoryDaily = Source{[Schema="FMT_Reporting",Item="V2V_GuestHistoryDaily"]}[Data],

    #"Filtered Rows" = Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd)),

    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rev_Room_Net_LC", "Rev_FB_Net_LC", "Rev_BQT_Net_LC", "Rev_SPA_Net_LC", "Rev_Ski_Net_LC", "Rev_Other_Net_LC"})

in

    #"Removed Columns"

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Xue! Thanks for this. It was indeed the issue. Aprreciated!

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.