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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Unable to filter data(measures used Summarize and SUMX) correctly with RLS(Row-Level-Security)

Hi Team,

 

I have a report that has aggregation logic for below market & above market level.

below market level aggregation is on the product level where as above market level agregation is on the Market level.

For above Market aggregation:

if Market 1 has sales £100 & Market 2 sales £200, when we see the total sales for the both market 1 & market2 it should be £300. It's working as expected when we use the report slicers but when testing the RLS it's populating as blank.

Ex: Market    Error_value   Total_Sales_AbvMarket    Accuracy(%)

     Canada    50                 100                                   1-(50/100) i.e 50%

      USA        150                200                                  1-(150/200) i.e 25%

Total :           200                300                                  1-(200/300) i.e 33.3%

 

Please see the ref formula used to calculate the Total Sales_Above Market:

Total Sales : Value_AboveMkt =
SUMX(
SUMMARIZE(
Sales_Fact,
Sales_Fact[Month],
Market_Hierarchy[Market],
"Total Sales:",
SUMX(
Sales_Fact,
[Total Sales: VALUE]
)
),
[Total Sales:]
)

 

Result occured: When trying to test the RLS with user have access to same markets as above (USA & Canada), KPI Accuracy (%) is populating as Infinity as Total Sales_Abvmarket is populating blank(capped to 0).

 

Market    Error_value   Total_Sales_AbvMarket    Accuracy(%)

     Canada    50                 100                                   1-(50/100) i.e 50%

      USA        150                200                                  1-(150/200) i.e 25%

Total :           200                blank                                infinity

 

I wasn't sure why the issue occured when testing with RLS, but when I referred to few blogs it says Summarize doesn't work when using RLS(I may be wrong)

 

Can anyone help me if the above calculation I have used is causing the issue?

if it's, please provide me the solution possibly.

 

Thanks,

Harsha

 

 

 

2 REPLIES 2
parry2k
Super User
Super User

@Anonymous not sure why you are doing sumx/summarize, why the simple sum is not used. There may be a reason for it but I cannot tell until seeing the sample data.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k ,

 

The reason that using the Sumx is we calculate the Total Sales for below market product level and it's the sum of Normal_sales & tender sales on the product level.

when it comes to above market level, we don't want it to be calculated at product we need it to be calculated at market level so for the above market level we are using the sum of indiviudal markets total sales that is already calculated on product level.

 

For example, let me put the scenario below.

for a market level the Accuacy (%) is 1-(Error value/Total Sales)

for above market level Accuracy (%) is mktsumof products/Total Sales.

here "MKTsumof products" if derived by multiplying the Total Sales with KPI accuracy(%) per market.

when we look at multiple markets it's the sum of it so I am using SUMX.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.