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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Bug in Power Query function Number.Mod

I just found a bug in the Power Query function Number.Mod.

According to the documentation the function should accept a 3rd optional argument (Precision). In Power BI desktop the 3rd argument is accepted without any error, but once the model is published to the service, it will fail when refreshing the data, reporting an error "Microsoft SQL: Operand data type float is invalid for modulo operator.".

The workaround is to rework the querylogic so that you do not need the 3rd argument, and then not enter it, but obviously the real solution is to make sure the behaviour of the function Number.Mod is identical in the service as on the desktop.

Status: Investigating

Hi @Anonymous 

 

May I know what kind of data types are your number and divisor?  What kind of value you used as the third parameter?

 

Best Regards,

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @Anonymous 

 

May I know what kind of data types are your number and divisor?  What kind of value you used as the third parameter?

 

Best Regards,

Community Support Team _ Caiyun

Anonymous
Not applicable

I was taking the mod of dividing an int64 representing a date (20211123 for example) by 100 (typed in the function as second argument, so no explicit type) with precision 0 (set it explicit) to get the day number from the integer, so I could substract it from the date and then add 1 to always make it represent the first of the month. Obviously I could have done without the explicit 0, but the issue is the inconsistent behaviour obviously, because that makes it harder to find the cause.

The desktop version accepts the precision parameter without any issue, but once the dataset containing this function had to refresh on the service, it failed to refresh because of it.

v-cazheng-msft
Community Support

Hi @Anonymous 

 

Thanks for your reply! According to your description, I've tested at my side. But I can't repro it. Please consider opening a support ticket by Support | Microsoft Power BI . There will be a suport engineer help you troubleshoot on this issue.

 

Best Regards,

Community Support Team _ Caiyun