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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
z-rising
Frequent Visitor

Update column based on 2 other columns

I have a report that is using row level security.  The team lead I made the dashboard for has requested I restrict a certain portion of the data.  I can do this easily by changing the values in the column I base RLS on, but I need to do it depending on 2 different vairiables.

 

Essentially I need to either update the values in the existing column, or create a new column that is something along the lines of:

 

= Table.AddColumn(#"Renamed Columns", "Updated Sort", each if [Account] = "12345" and [Cost Center No] = "67890" then "Remove" else {"Original Sort})

 

This formula isn't working for me, where I am trying to create a new column that populates the value as "Remove" is the value in the Account column is 12345 and the value in the Cost Center No is 67890.  If it is not both, then use the value in column Original Sort.

 

An added layer of complexity is that I need this for 4 different Cost Center No values, though all the same Account, hopfully without creating 4 different new columns.

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@z-rising 

i think the bracket for orginial sort is wrong, pls try

[ Original Sort]





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi @z-rising ,

@ryan_mayu Thanks for your concern about this case!
And In addition to what @ryan_mayu  said, I would like to remind you that you are using "12345" and "67890" in your code, I am not sure what kind of data you have, but the addition of " " means it is a text type column. If you say that these two columns should be of type Number, then you need to remove the "".

vjunyantmsft_0-1716429497425.png

vjunyantmsft_1-1716429548851.png


About "An added layer of complexity is that I need this for 4 different Cost Center No values, though all the same Account, hopfully without creating 4 different new columns." Can you show us your data and the expected results? Maybe we can help you find a quicker solution.

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @z-rising ,

@ryan_mayu Thanks for your concern about this case!
And In addition to what @ryan_mayu  said, I would like to remind you that you are using "12345" and "67890" in your code, I am not sure what kind of data you have, but the addition of " " means it is a text type column. If you say that these two columns should be of type Number, then you need to remove the "".

vjunyantmsft_0-1716429497425.png

vjunyantmsft_1-1716429548851.png


About "An added layer of complexity is that I need this for 4 different Cost Center No values, though all the same Account, hopfully without creating 4 different new columns." Can you show us your data and the expected results? Maybe we can help you find a quicker solution.

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

ryan_mayu
Super User
Super User

@z-rising 

i think the bracket for orginial sort is wrong, pls try

[ Original Sort]





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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
Top Kudoed Authors