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

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.