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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

RLS on working on Calculated Column

I found that Row Level Security does not work on calculated colum.  

The follwoing is my simple data model.

demodatamodel.PNG

I have 3 measures defined on Price table:

Retail Low := CALCULATE(MIN(Price[Price]),PriceType[Price_Type_Name]="Retail")
Wholesale Low := CALCULATE(MIN(Price[Price]),PriceType[Price_Type_Name]="Wholesale")
PriceDiffMeasure := [Wholesale Low]-[Retail Low]
A calculated colum is defined on Terminal table:
Ternimal[DiffCalucatedCol] = Price[PriceDiffMeasure]
When no RLS is applied, the PriceDiffMeasure and Ternimal[DiffCalucatedCol] have same value, as I have expected. The following is a screenshot of table showing this:
tablenoRLSapplied.PNG
I created a RLS rule applied to Price table. (Customer_ID=2). However, I see DiffCalucatedCol and PriceDiffMeasure have different values. Compared with table above, value of  DiffCalcuatedCol did not change after RLS is applied. 
TableRLSapplied.PNG
The following is RLS rule setting. 
 
RLSRuleSetting.PNG
 
The following is the screenshot of Price table
PriceTableExample.PNG
 I have to use Caluclated Column in the terminal table since it will be eventually used as a legend of a Map and measure can't be used as legend on a map.  Does anyone know how to apply RLS to calculated column?
The related pbix file can be found here.

 

4 REPLIES 4
d_gosbell
Super User
Super User


@Anonymous wrote:
  Does anyone know how to apply RLS to calculated column?

 


You can't do this, calculated columns are calculated once during data refresh over all the data in the model. RLS rules are applied dynamically at run time, so by the time the RLS kicks in the calculated column is already calculated.

 

Do you need to have every distinct difference value in your legend? If not you could use a dynamic segmentation approach to group the different values eg https://www.daxpatterns.com/dynamic-segmentation/ into various ranges of differences.

Anonymous
Not applicable

@d_gosbell  thank you for the repsone.  I don't need to show every distince value.  The legend of map is categories of price diff range. I have not looked every line of dynamic segmentation, but it seems this methond can generate range measures.  However, my problem is that measure CAN'T be used a the legend of map. do you have any suggestions?


@Anonymous wrote:

@d_gosbell  thank you for the repsone.  I don't need to show every distince value.  The legend of map is categories of price diff range. I have not looked every line of dynamic segmentation, but it seems this methond can generate range measures.  However, my problem is that measure CAN'T be used a the legend of map. do you have any suggestions?


No it uses a combination of a measure and a segment table. The idea then is to use a COLUMN from the segment table in the Legend. Assuming that you are using either the standard "Map" or "Filled Map" visual where you put the measure in the Color Saturation or Size field wells.

 

If you are using the "Map" visual and you used the data set from the article you would put the Ranges[Price Range] column on the Legend and the [SalesRange] measure on the Size. 

Anonymous
Not applicable

Hi @Anonymous ,

The available map visuals in Power BI doesn't support measure values in legend section.
You can try with other other map custom visuals from https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals. But not sure, these visuals have that feature or not.

Thanks,
Amit

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors