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

View all the Fabric Data Days sessions on demand. View schedule

Reply
pavannarani
Helper III
Helper III

RAND() function not working in Fabric warehouse

Hello

 

 

I have a requirement to auto generate the numbers between two integers like 10 and 100. when i searched in bing for warehouse it is saying that RAND() function should work but when i actually tried its not working giving the below error. 

 

did anyone faced it help me in resolving this issue. Thanks in advance.

 

SELECT RAND()*(10-5)+5; 

 

pavannarani_0-1717431803989.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @pavannarani 

Not all T-SQL function are support in Fabric Warehouse, you can try this code.

SELECT ABS(CHECKSUM(NEWID())) % (100 - 10 + 1) + 10

vyaningymsft_0-1717465936398.png

T-SQL statements in dedicate SQL pool - Azure Synapse Analytics | Microsoft Learn

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
pavannarani
Helper III
Helper III

Thank you so much @Anonymous it worked.

Anonymous
Not applicable

Hi, @pavannarani 

Not all T-SQL function are support in Fabric Warehouse, you can try this code.

SELECT ABS(CHECKSUM(NEWID())) % (100 - 10 + 1) + 10

vyaningymsft_0-1717465936398.png

T-SQL statements in dedicate SQL pool - Azure Synapse Analytics | Microsoft Learn

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors