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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
dinesh123
Helper II
Helper II

Embedded RLS

We are applying Embedded RLS in our power bi report however, there is a limitation of characters we can send from Username (limit 256 Characters). But need to pass more than 256 characters. Using Java SDK. 

1 REPLY 1
jaweher899
Impactful Individual
Impactful Individual

The limitation of 256 characters for usernames in Power BI Embedded RLS is a hard limit imposed by the service, and there is no way to increase this limit.

However, if you need to pass more than 256 characters in your usernames, you could consider using a hashing algorithm to generate a unique and shorter identifier for each user. You can then use this identifier instead of the full username in your RLS rules.

To generate the unique identifier, you can use a cryptographic hash function such as SHA-256 or MD5 to generate a hash of the user's full name or email address. The resulting hash value will be a fixed length and can be used as a key to identify the user in your RLS rules.

Here's an example Java code that shows how to generate a SHA-256 hash of a string:

 

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class HashingExample {
public static void main(String[] args) throws NoSuchAlgorithmException {
String input = "user@example.com";
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF_8));
String hexHash = bytesToHex(hash);
System.out.println(hexHash); // use this value as the user identifier in your RLS rules
}

private static String bytesToHex(byte[] bytes) {
StringBuilder hex = new StringBuilder(2 * bytes.length);
for (byte b : bytes) {
hex.append(String.format("%02x", b));
}
return hex.toString();
}
}

 

This code generates a SHA-256 hash of the string "user@example.com" and prints the resulting hash value as a hexadecimal string. You can modify this code to generate hashes for your own user names or email addresses. Just make sure to use a secure and widely-used hash function and to keep the salt value consistent across all users.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.