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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
datboioscarr
Frequent Visitor

Replace Text Value on Table based on Conditions

Hello,

 

Is it possible to dynamically replace values on a table at the row level? I'm currently working on a report that needs to solve the following:

 

Highlight what access level a user has to one of our companies application based on a table. If a user has access to Market level data, show what market the user has access to. 

 

I've been able to get my report to highlight what access level the user has but not sure how to replace values at a row level based on a few conditions. For instance, in the following table under the resource column I would like to update "Your Market" with a value that is refrenced from another table once a user has been selected from the slicer. 

 

Access LevelCostResource LevelCost Data
AdminAll MarketsAll MarketsAll Markets
AdvancedAll MarketsYou MarketYour Market

 

The current action on the table is as follows:

- When the user name is selected from the slicer, the users access is highlighted

-If a user has access to a specific market, it currently just shows "Your Market" but I do currently have a tooltip that will display the users 'Market' based on the following formula:

 

Markets= CONCATENATEX(DISTINCT('Markets'[MarketName]),'Markets'[MarketName],",")
 
Note: if they have more than one market avaialbe to them, the markets will be listed....
 
Any thoughts on how I can best accomplish the ability to replace values at a row level? 
2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @datboioscarr 

 

If the above post helps, then please consider Accept it as the solution. Thank  you😀
It will help the others in the community find the solution easily if they face the same problem with you.

 

In addition, row-level security may be useful to you.

Row level security is a Power Bi feature that allows you to create rules for users. Those rules (DAX code) will filter the current model.

You can read more in microsoft doc: https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls

That will show how to implement it.

Here you have a second link in case you feel that the first documentation won't work because you have too many Regions to create rules. There are ways to make it dynamic but it might be a little more complex: https://blog.ladataweb.com.ar/post/652895563673649152/powerbi-seguridad-de-filas-rls-con-regla

I hope all of that helps you.

 

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

v-angzheng-msft
Community Support
Community Support

Hi, @datboioscarr 

 

I created a simple sample

Tables:

vangzhengmsft_2-1629952361110.png

To create a measure like this:

 

_Show = 
var _leverID=CALCULATE(MAX('Member'[Level ID]),ALLSELECTED('Member'[Name]))
var _market=CALCULATE(MAX('Access'[Market]),FILTER(Access,'Access'[Level ID]=_leverID))
var _isIn=IF(CONTAINSSTRING(_market,MAX('Data'[Market])),1)
return _isIn

 

Then display value when item is 1 in the filter pane

vangzhengmsft_4-1629952639435.png

Result:

vangzhengmsft_3-1629952477795.png

Please refer to the attachment below for details. Hope this helps.

If I did not understand your question correctly, please consdier sharing more details about it or a simple sample file without any sesentive information for further discussion.

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.